From 2f656087f0e6432a4f2f243283585c34b0d6c801 Mon Sep 17 00:00:00 2001 From: Brian Silverman Date: Wed, 8 Aug 2018 15:27:00 -0700 Subject: Fix broken test of const repeated field iterators The old version had a NOP for loop, which doesn't make sense. I'm pretty sure this was the original intention. Newer GCC's -Wunused-but-set-variable flags the old version. --- src/google/protobuf/extension_set_unittest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/extension_set_unittest.cc b/src/google/protobuf/extension_set_unittest.cc index bc65d295..f121c79c 100644 --- a/src/google/protobuf/extension_set_unittest.cc +++ b/src/google/protobuf/extension_set_unittest.cc @@ -1055,7 +1055,7 @@ TEST(ExtensionSetTest, RepeatedFields) { unittest::repeated_nested_enum_extension).begin(), enum_const_end = message.GetRepeatedExtension( unittest::repeated_nested_enum_extension).end(); - enum_iter != enum_end; ++enum_iter) { + enum_const_iter != enum_const_end; ++enum_const_iter) { ASSERT_EQ(*enum_const_iter, unittest::TestAllTypes::NestedEnum_MAX); } -- cgit v1.2.3 From f0b8a57fe64286da5781385a6318faba0cbad9dc Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Thu, 9 Aug 2018 15:22:22 -0700 Subject: Cleanup kokoro scripts. Changes: 1. Remove stuff no longer needed. Lots of the heavy lifting were there because we were running our own jenkins cluster and had to manage all the test logs ourselves. Now they are useless. 2. Change "-j2" to "-j4" to speed up the test a little bit. Kokoro machines have 4 logic CPUs according to their spec. --- kokoro/linux/build_and_run_docker.sh | 13 ++------- kokoro/linux/pull_request_in_docker.sh | 50 +--------------------------------- tests.sh | 6 ++-- 3 files changed, 6 insertions(+), 63 deletions(-) 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 diff --git a/tests.sh b/tests.sh index 5bb8ae39..4ae766c8 100755 --- a/tests.sh +++ b/tests.sh @@ -18,12 +18,12 @@ internal_build_cpp() { ./autogen.sh ./configure CXXFLAGS="-fPIC" # -fPIC is needed for python cpp test. # See python/setup.py for more details - make -j2 + make -j4 } build_cpp() { internal_build_cpp - make check -j2 || (cat src/test-suite.log; false) + make check -j4 || (cat src/test-suite.log; false) cd conformance && make test_cpp && cd .. # The benchmark code depends on cmake, so test if it is installed before @@ -68,7 +68,7 @@ build_cpp_distcheck() { fi # Do the regular dist-check for C++. - make distcheck -j2 + make distcheck -j4 } build_csharp() { -- cgit v1.2.3