diff options
Diffstat (limited to 'kokoro/linux')
-rwxr-xr-x | kokoro/linux/bazel/build.sh | 1 | ||||
-rwxr-xr-x | kokoro/linux/benchmark/build.sh | 6 | ||||
-rwxr-xr-x | kokoro/linux/build_and_run_docker.sh | 15 | ||||
-rwxr-xr-x | kokoro/linux/cpp_distcheck/build.sh | 14 | ||||
-rw-r--r-- | kokoro/linux/prepare_build_linux_rc | 2 | ||||
-rwxr-xr-x | kokoro/linux/pull_request_in_docker.sh | 48 |
6 files changed, 22 insertions, 64 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 af5b299e..527485c8 100755 --- a/kokoro/linux/benchmark/build.sh +++ b/kokoro/linux/benchmark/build.sh @@ -68,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 @@ -86,7 +86,7 @@ echo "benchmarking java..." # upload result to bq make python_add_init -env LD_LIBRARY_PATH="$oldpwd/src/.libs" 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 6a1f327a..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)/../.. @@ -35,9 +34,10 @@ echo $git_root docker run \ "$@" \ -e CCACHE_DIR=$CCACHE_DIR \ + -e KOKORO_BUILD_NUMBER=$KOKORO_BUILD_NUMBER \ + -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 \ @@ -45,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/cpp_distcheck/build.sh b/kokoro/linux/cpp_distcheck/build.sh index b8b57e35..89b8379e 100755 --- a/kokoro/linux/cpp_distcheck/build.sh +++ b/kokoro/linux/cpp_distcheck/build.sh @@ -5,7 +5,15 @@ # Change to repo root cd $(dirname $0)/../../.. -# Prepare worker environment to run tests -source kokoro/linux/prepare_build_linux_rc - ./tests.sh cpp_distcheck + +# Run tests under release docker image. +DOCKER_IMAGE_NAME=protobuf/protoc_$(sha1sum protoc-artifacts/Dockerfile | cut -f1 -d " ") +docker pull $DOCKER_IMAGE_NAME + +docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \ + bash -l /var/local/protobuf/tests.sh cpp || FAILED="true" + +if [ "$FAILED" = "true" ]; then + exit 1 +fi diff --git a/kokoro/linux/prepare_build_linux_rc b/kokoro/linux/prepare_build_linux_rc index f64ea952..d9b3bec3 100644 --- a/kokoro/linux/prepare_build_linux_rc +++ b/kokoro/linux/prepare_build_linux_rc @@ -7,7 +7,7 @@ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsof sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF sudo apt-get update # We use the .NET Core SDK 2.x to build... -sudo apt-get install -y dotnet-sdk-2.0.3 +sudo apt-get install -y dotnet-sdk-2.1.3 # But we also need the 1.x framework to test against, as we # target netstandard1.x sudo apt-get install -y dotnet-sharedframework-microsoft.netcore.app-1.0.5 diff --git a/kokoro/linux/pull_request_in_docker.sh b/kokoro/linux/pull_request_in_docker.sh index df3636cc..a048c470 100755 --- a/kokoro/linux/pull_request_in_docker.sh +++ b/kokoro/linux/pull_request_in_docker.sh @@ -5,7 +5,7 @@ WORKSPACE_BASE=`pwd` MY_DIR="$(dirname "$0")" -TEST_SCRIPT=$MY_DIR/../../tests.sh +TEST_SCRIPT=./tests.sh BUILD_DIR=/tmp/protobuf set -e # exit immediately on error @@ -22,48 +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 \ - || 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 +$TEST_SCRIPT $TEST_SET |