OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # This is the script that runs inside Docker, once the image has been built, | 3 # This is the script that runs inside Docker, once the image has been built, |
4 # to execute all tests for the "pull request" project. | 4 # to execute all tests for the "pull request" project. |
5 | 5 |
6 WORKSPACE_BASE=`pwd` | 6 WORKSPACE_BASE=`pwd` |
7 MY_DIR="$(dirname "$0")" | 7 MY_DIR="$(dirname "$0")" |
8 TEST_SCRIPT=$MY_DIR/../tests.sh | 8 TEST_SCRIPT=$MY_DIR/../tests.sh |
9 BUILD_DIR=/tmp/protobuf | 9 BUILD_DIR=/tmp/protobuf |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 CPP_STDOUT=$LOG_OUTPUT_DIR/1/cpp/stdout | 38 CPP_STDOUT=$LOG_OUTPUT_DIR/1/cpp/stdout |
39 CPP_STDERR=$LOG_OUTPUT_DIR/1/cpp/stderr | 39 CPP_STDERR=$LOG_OUTPUT_DIR/1/cpp/stderr |
40 | 40 |
41 # Time the C++ build, so we can put this info in the test output. | 41 # Time the C++ build, so we can put this info in the test output. |
42 # It's important that we get /usr/bin/time (which supports -f and -o) and not | 42 # It's important that we get /usr/bin/time (which supports -f and -o) and not |
43 # the bash builtin "time" which doesn't. | 43 # the bash builtin "time" which doesn't. |
44 TIME_CMD="/usr/bin/time -f %e -o $LOG_OUTPUT_DIR/1/cpp/build_time" | 44 TIME_CMD="/usr/bin/time -f %e -o $LOG_OUTPUT_DIR/1/cpp/build_time" |
45 | 45 |
46 $TIME_CMD $TEST_SCRIPT cpp > >(tee $CPP_STDOUT) 2> >(tee $CPP_STDERR >&2) | 46 $TIME_CMD $TEST_SCRIPT cpp > >(tee $CPP_STDOUT) 2> >(tee $CPP_STDERR >&2) |
47 | 47 |
48 # Other tests are run in parallel. | 48 # Other tests are run in parallel. TEST_SET is defined in |
| 49 # buildcmds/pull_request{_32}.sh |
49 | 50 |
50 parallel --results $LOG_OUTPUT_DIR --joblog $OUTPUT_DIR/joblog $TEST_SCRIPT :::
\ | 51 parallel --results $LOG_OUTPUT_DIR --joblog $OUTPUT_DIR/joblog $TEST_SCRIPT :::
\ |
51 csharp \ | 52 $TEST_SET \ |
52 java_jdk7 \ | |
53 javanano_jdk7 \ | |
54 java_oracle7 \ | |
55 javanano_oracle7 \ | |
56 python \ | |
57 python_cpp \ | |
58 ruby21 \ | |
59 || true # Process test results even if tests fail. | 53 || true # Process test results even if tests fail. |
60 | 54 |
61 cat $OUTPUT_DIR/joblog | 55 cat $OUTPUT_DIR/joblog |
62 | 56 |
63 # The directory that is copied from Docker back into the Jenkins workspace. | 57 # The directory that is copied from Docker back into the Jenkins workspace. |
64 COPY_FROM_DOCKER=/var/local/git/protobuf/testoutput | 58 COPY_FROM_DOCKER=/var/local/git/protobuf/testoutput |
65 mkdir -p $COPY_FROM_DOCKER | 59 mkdir -p $COPY_FROM_DOCKER |
66 TESTOUTPUT_XML_FILE=$COPY_FROM_DOCKER/testresults.xml | 60 TESTOUTPUT_XML_FILE=$COPY_FROM_DOCKER/testresults.xml |
67 | 61 |
68 # Process all the output files from "parallel" and package them into a single | 62 # Process all the output files from "parallel" and package them into a single |
69 # .xml file with detailed, broken-down test output. | 63 # .xml file with detailed, broken-down test output. |
70 python $MY_DIR/make_test_output.py $OUTPUT_DIR > $TESTOUTPUT_XML_FILE | 64 python $MY_DIR/make_test_output.py $OUTPUT_DIR > $TESTOUTPUT_XML_FILE |
71 | 65 |
72 ls -l $TESTOUTPUT_XML_FILE | 66 ls -l $TESTOUTPUT_XML_FILE |
OLD | NEW |