aboutsummaryrefslogtreecommitdiff
path: root/kokoro/linux
diff options
context:
space:
mode:
Diffstat (limited to 'kokoro/linux')
-rwxr-xr-xkokoro/linux/bazel/build.sh1
-rwxr-xr-xkokoro/linux/benchmark/build.sh19
-rwxr-xr-xkokoro/linux/build_and_run_docker.sh13
-rwxr-xr-xkokoro/linux/pull_request_in_docker.sh50
4 files changed, 16 insertions, 67 deletions
diff --git a/kokoro/linux/bazel/build.sh b/kokoro/linux/bazel/build.sh
index e0c1ee42..1769301d 100755
--- a/kokoro/linux/bazel/build.sh
+++ b/kokoro/linux/bazel/build.sh
@@ -1,6 +1,7 @@
#!/bin/bash
#
# Build file to set up and run tests
+set -ex
# Change to repo root
cd $(dirname $0)/../../..
diff --git a/kokoro/linux/benchmark/build.sh b/kokoro/linux/benchmark/build.sh
index 750c3e5c..527485c8 100755
--- a/kokoro/linux/benchmark/build.sh
+++ b/kokoro/linux/benchmark/build.sh
@@ -27,8 +27,8 @@ cd $oldpwd
./configure CXXFLAGS="-fPIC -O2"
make -j8
cd python
-python setup.py -q build --cpp_implementation
-pip install .
+python setup.py build --cpp_implementation
+pip install . --user
# build and run Python benchmark
@@ -41,10 +41,10 @@ echo "benchmarking pure python..."
./python-pure-python-benchmark --json --behavior_prefix="pure-python-benchmark" $datasets >> tmp/python_result.json
echo "," >> "tmp/python_result.json"
echo "benchmarking python cpp reflection..."
-env LD_PRELOAD="$oldpwd/gperftools/.libs/libtcmalloc.so" ./python-cpp-reflection-benchmark --json --behavior_prefix="cpp-reflection-benchmark" $datasets >> tmp/python_result.json
+env LD_PRELOAD="$oldpwd/gperftools/.libs/libtcmalloc.so" LD_LIBRARY_PATH="$oldpwd/src/.libs" ./python-cpp-reflection-benchmark --json --behavior_prefix="cpp-reflection-benchmark" $datasets >> tmp/python_result.json
echo "," >> "tmp/python_result.json"
echo "benchmarking python cpp generated code..."
-env LD_PRELOAD="$oldpwd/gperftools/.libs/libtcmalloc.so" ./python-cpp-generated-code-benchmark --json --behavior_prefix="cpp-generated-code-benchmark" $datasets >> tmp/python_result.json
+env LD_PRELOAD="$oldpwd/gperftools/.libs/libtcmalloc.so" LD_LIBRARY_PATH="$oldpwd/src/.libs" ./python-cpp-generated-code-benchmark --json --behavior_prefix="cpp-generated-code-benchmark" $datasets >> tmp/python_result.json
echo "]" >> "tmp/python_result.json"
cd $oldpwd
@@ -52,6 +52,11 @@ cd $oldpwd
./configure
make clean && make -j8
+# build Java protobuf
+cd java
+mvn package
+cd ..
+
# build CPP benchmark
cd benchmarks
mv tmp/python_result.json . && make clean && make -j8 cpp-benchmark && mv python_result.json tmp
@@ -63,8 +68,8 @@ cd $oldpwd
export PATH="`pwd`/src:$PATH"
export GOPATH="$HOME/gocode"
mkdir -p "$GOPATH/src/github.com/google"
-rm -f "$GOPATH/src/github.com/google/protobuf"
-ln -s "`pwd`" "$GOPATH/src/github.com/google/protobuf"
+rm -f "$GOPATH/src/github.com/protocolbuffers/protobuf"
+ln -s "`pwd`" "$GOPATH/src/github.com/protocolbuffers/protobuf"
export PATH="$GOPATH/bin:$PATH"
go get github.com/golang/protobuf/protoc-gen-go
@@ -81,7 +86,7 @@ echo "benchmarking java..."
# upload result to bq
make python_add_init
-python util/run_and_upload.py -cpp="../tmp/cpp_result.json" -java="../tmp/java_result.json" \
+env LD_LIBRARY_PATH="$oldpwd/src/.libs" python -m util.result_uploader -cpp="../tmp/cpp_result.json" -java="../tmp/java_result.json" \
-python="../tmp/python_result.json" -go="../tmp/go_result.txt"
cd $oldpwd
diff --git a/kokoro/linux/build_and_run_docker.sh b/kokoro/linux/build_and_run_docker.sh
index f9c60710..b81a3684 100755
--- a/kokoro/linux/build_and_run_docker.sh
+++ b/kokoro/linux/build_and_run_docker.sh
@@ -8,7 +8,6 @@
# OUTPUT_DIR - Directory that will be copied from inside docker after finishing.
# $@ - Extra args to pass to docker run
-
set -ex
cd $(dirname $0)/../..
@@ -39,7 +38,6 @@ docker run \
-e KOKORO_BUILD_ID=$KOKORO_BUILD_ID \
-e EXTERNAL_GIT_ROOT="/var/local/kokoro/protobuf" \
-e TEST_SET="$TEST_SET" \
- -e THIS_IS_REALLY_NEEDED='see https://github.com/docker/docker/issues/14203 for why docker is awful' \
-v "$git_root:/var/local/kokoro/protobuf:ro" \
-v $CCACHE_DIR:$CCACHE_DIR \
-w /var/local/git/protobuf \
@@ -47,16 +45,9 @@ docker run \
$DOCKER_IMAGE_NAME \
bash -l "/var/local/kokoro/protobuf/$DOCKER_RUN_SCRIPT" || FAILED="true"
-# Copy output artifacts
-if [ "$OUTPUT_DIR" != "" ]
-then
- docker cp "$CONTAINER_NAME:/var/local/git/protobuf/$OUTPUT_DIR" "${git_root}/kokoro" || FAILED="true"
-fi
-
# remove the container, possibly killing it first
docker rm -f $CONTAINER_NAME || true
-if [ "$FAILED" != "" ]
-then
+[ -z "$FAILED" ] || {
exit 1
-fi
+}
diff --git a/kokoro/linux/pull_request_in_docker.sh b/kokoro/linux/pull_request_in_docker.sh
index e28ef958..a048c470 100755
--- a/kokoro/linux/pull_request_in_docker.sh
+++ b/kokoro/linux/pull_request_in_docker.sh
@@ -22,52 +22,4 @@ cd protobuf
# Initialize any submodules:
git submodule update --init --recursive
-# Set up the directory where our test output is going to go.
-OUTPUT_DIR=`mktemp -d`
-LOG_OUTPUT_DIR=$OUTPUT_DIR/logs
-mkdir -p $LOG_OUTPUT_DIR/1/cpp
-
-################################################################################
-# cpp build needs to run first, non-parallelized, so that protoc is available
-# for other builds.
-
-# Output filenames to follow the overall scheme used by parallel, ie:
-# $DIR/logs/1/cpp/stdout
-# $DIR/logs/1/cpp/stderr
-# $DIR/logs/1/csharp/stdout
-# $DIR/logs/1/csharp/stderr
-# $DIR/logs/1/java_jdk7/stdout
-# $DIR/logs/1/java_jdk7/stderr
-CPP_STDOUT=$LOG_OUTPUT_DIR/1/cpp/stdout
-CPP_STDERR=$LOG_OUTPUT_DIR/1/cpp/stderr
-
-# Time the C++ build, so we can put this info in the test output.
-# It's important that we get /usr/bin/time (which supports -f and -o) and not
-# the bash builtin "time" which doesn't.
-TIME_CMD="/usr/bin/time -f %e -o $LOG_OUTPUT_DIR/1/cpp/build_time"
-
-$TIME_CMD $TEST_SCRIPT cpp > >(tee $CPP_STDOUT) 2> >(tee $CPP_STDERR >&2)
-
-# Other tests are run in parallel. TEST_SET is defined in
-# buildcmds/pull_request{_32}.sh
-
-parallel --results $LOG_OUTPUT_DIR --joblog $OUTPUT_DIR/joblog $TEST_SCRIPT ::: \
- $TEST_SET \
- || FAILED="true" # Process test results even if tests fail.
-
-cat $OUTPUT_DIR/joblog
-
-# The directory that is copied from Docker back into the Kokoro workspace.
-COPY_FROM_DOCKER=/var/local/git/protobuf/testoutput
-mkdir -p $COPY_FROM_DOCKER
-TESTOUTPUT_XML_FILE=$COPY_FROM_DOCKER/sponge_log.xml
-
-# Process all the output files from "parallel" and package them into a single
-# .xml file with detailed, broken-down test output.
-python $MY_DIR/make_test_output.py $OUTPUT_DIR > $TESTOUTPUT_XML_FILE
-
-ls -l $TESTOUTPUT_XML_FILE
-
-if [ "$FAILED" == "true" ]; then
- exit 1
-fi
+$TEST_SCRIPT $TEST_SET