forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated [] rollback of commit 53b10ea.
*** Reason for rollback *** Rolling forward after fixing Mac tests, and adding coverage to Kokoro. *** Original change description *** Automated [] rollback of commit d8eec34. *** Reason for rollback *** These tests break on Mac: http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=darwin-x86_64/561/console E.g.: ERROR: /Users/ci/workspace/bazel-tests/BAZEL_VERSION/HEAD/PLATFORM_NAME/darwin-x86_64/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD:64:1: Couldn't build file src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4_testbridge_integration_test.runfi... *** ROLLBACK_OF=147587929 -- PiperOrigin-RevId: 147746587 MOS_MIGRATED_REVID=147746587
- Loading branch information
Showing
9 changed files
with
520 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...itrunner/javatests/com/google/testing/junit/runner/antxmlresultwriter_integration_test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2015 The Bazel Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Integration testing of the AntXmlResultWriter. | ||
# | ||
|
||
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
|
||
TESTBED="${PWD}/$1" | ||
XML_GOLDEN_OUTPUT_FILE="${PWD}/$2" | ||
XML_OUTPUT_FILE="${TEST_TMPDIR}/test.xml" | ||
SUITE_PARAMETER="$3" | ||
SUITE="com.google.testing.junit.runner.testbed.XmlOutputExercises" | ||
SUITE_FLAG="-D${SUITE_PARAMETER}=${SUITE}" | ||
|
||
shift 3 | ||
source ${DIR}/testenv.sh || { echo "testenv.sh not found!" >&2; exit 1; } | ||
|
||
function test_XmlOutputExercises() { | ||
cd $TEST_TMPDIR | ||
|
||
$TESTBED --jvm_flag=${SUITE_FLAG} || true # Test failures | ||
|
||
# Remove timestamps and test runtime from the XML files as they will always differ and cause a | ||
# mismatch. | ||
sed -i.bak -E "s/(time[^=]*)='[^']*/\1='/g" $XML_OUTPUT_FILE \ | ||
|| fail "sed to remove timestamps failed" | ||
|
||
# Removes the stacktrace from the XML files, it can vary between JDK versions. | ||
sed -i.bak -E '/\w*at [a-zA-Z0-9\$\.]+\([a-zA-Z0-9 \.]*(:[0-9]+)?\)$/d' \ | ||
"${XML_OUTPUT_FILE}" || fail "sed to remove stacktraces failed" | ||
|
||
diff -wu $XML_GOLDEN_OUTPUT_FILE $XML_OUTPUT_FILE \ | ||
|| fail "Did not expect a diff between the golden file and the generated XML output." | ||
} | ||
|
||
run_suite "antxmlresultwriter" |
46 changes: 46 additions & 0 deletions
46
...ols/junitrunner/javatests/com/google/testing/junit/runner/deploy_jar_integration_tests.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2012 The Bazel Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Integration testing of _deploy.jar behavior. Not using the runfiles wrapper | ||
# can create a few puzzling hazards. This verifies that we warn the user for | ||
# the most obvious ones. | ||
# | ||
# These tests operate by executing test methods in a testbed deploy.jar program | ||
# and checking the output. | ||
# | ||
|
||
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
|
||
unset TEST_PREMATURE_EXIT_FILE | ||
JAVA_HOME="$1" | ||
TESTBED_JAR="${PWD}/$2" | ||
|
||
shift 2 | ||
source ${DIR}/testenv.sh || { echo "testenv.sh not found!" >&2; exit 1; } | ||
|
||
####################### | ||
|
||
# Test that we see a warning about missing the test suite Java system property | ||
function test_Warning() { | ||
test_pid="" | ||
${JAVA_HOME}/bin/java -jar $TESTBED_JAR >& $TEST_log && test_pid=$! | ||
|
||
expect_log "The test suite Java system property .* is required but missing" | ||
|
||
wait $test_pid || fail "Expected process to finish successfully" | ||
} | ||
|
||
run_suite "deploy_jar" |
76 changes: 76 additions & 0 deletions
76
...itrunner/javatests/com/google/testing/junit/runner/junit4_testbridge_integration_tests.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2015 The Bazel Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Integration testing of the test bridge protocol for JUnit4 tests. | ||
# This is a test filter passed by "bazel test --test_filter". | ||
# | ||
# These tests operate by executing test methods in a testbed program | ||
# and checking the output. | ||
# | ||
|
||
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
|
||
TESTBED="${PWD}/$1" | ||
SUITE_PARAMETER="$2" | ||
SUITE_FLAG="-D${SUITE_PARAMETER}=com.google.testing.junit.runner.testbed.JUnit4TestbridgeExercises" | ||
|
||
shift 2 | ||
source ${DIR}/testenv.sh || { echo "testenv.sh not found!" >&2; exit 1; } | ||
|
||
####################### | ||
|
||
function set_up() { | ||
# By default, the environment flag is unset. | ||
declare +x TESTBRIDGE_TEST_ONLY | ||
} | ||
|
||
# Test that we respond to TESTBRIDGE_TEST_ONLY in JUnit4 tests. | ||
function test_Junit4() { | ||
cd $TEST_TMPDIR | ||
|
||
# Run the test without environment flag; it should fail. | ||
declare +x TESTBRIDGE_TEST_ONLY | ||
$TESTBED --jvm_flag=${SUITE_FLAG} >& $TEST_log && fail "Expected failure" | ||
expect_log 'Failures: 1' | ||
|
||
# Run the test with environment flag. | ||
declare -x TESTBRIDGE_TEST_ONLY="doRun" | ||
$TESTBED --jvm_flag=${SUITE_FLAG} >& $TEST_log || fail "Expected success" | ||
expect_log 'OK.*1 test' | ||
|
||
# Finally, run the test once again without environment flag; it should fail. | ||
declare +x TESTBRIDGE_TEST_ONLY | ||
$TESTBED --jvm_flag=${SUITE_FLAG} >& $TEST_log && fail "Expected failure again" | ||
expect_log 'Failures: 1' | ||
} | ||
|
||
# Test that TESTBRIDGE_TEST_ONLY is overridden by a direct flag. | ||
function test_Junit4FlagOverridesEnv() { | ||
cd $TEST_TMPDIR | ||
|
||
# Run the test with both environment and command line flags. | ||
declare -x TESTBRIDGE_TEST_ONLY="doNotRun" | ||
$TESTBED --jvm_flag=${SUITE_FLAG} --test_filter doRun >& $TEST_log || \ | ||
fail "Expected success" | ||
expect_log 'OK.*1 test' | ||
|
||
declare -x TESTBRIDGE_TEST_ONLY="doRun" | ||
$TESTBED --jvm_flag=${SUITE_FLAG} --test_filter doNotRun >& $TEST_log && \ | ||
fail "Expected failure" | ||
expect_log 'Failures: 1' | ||
} | ||
|
||
run_suite "testbridge_test_only" |
Oops, something went wrong.