aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner
Commit message (Collapse)AuthorAge
* Replace //tools/defaults:jdk to //tools/jdk:*Gravatar dbabkin2018-06-26
| | | | | | | As //tools/defaults will be deprecated soon. All usages of //tools/defaults:jdk and //tools/defaults:java_toolchain should be replaced by corresponding targets in //tools/jdk/BUILD package RELNOTES:none PiperOrigin-RevId: 202114489
* Use JUnit assertions instead of Truth assertions.Gravatar cpovirk2018-03-27
| | | | | | | | | | The format of Truth's failure messages is about to change, which would break these tests. Alternatively, I could modify these tests to accept both the old and new Truth message formats, but ideally most tests wouldn't rely on the exact message format at all. (That suggests that an even better approach might be to just throw an exception whose message is a fixed string. That would avoid relying even on JUnit's message format, unlikely as I think that is to change.) RELNOTES: None. PiperOrigin-RevId: 190617095
* Automated rollback of commit 2ee6dd262bcf5fd890e24d5f185616b8ab259608.Gravatar philwo2018-03-19
| | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollforward as requested by the original author @hmemcpy. *** Original change description *** Skipping writing FILTERED tests to test.xml This fixes #3201 by preventing tests that haven't actually run to be written to the test.xml. This is consistent with how e.g. surefire reports work, tests that were filtered out do not appear in the xml. This allows changing the Bazel plugin in such a way that does not depend on `time` being 0.0. Closes #4596. PiperOrigin-RevId: 189610180
* Allow @Ignore on junit test classesGravatar Stephen Amar2018-03-13
| | | | | | | | | | | | | | | | | | | | | | | | Currently a test class annotated with `@Ignore` will cause the test runner to fail with ``` Exception in thread "main" java.lang.IllegalArgumentException: Top test must be a suite at com.google.testing.junit.runner.junit4.JUnit4TestModelBuilder.get(JUnit4TestModelBuilder.java:53) ``` This change treats classes with no tests (either no @Test annotations or @Ignore at class level) as an empty test suite. The main motivation behind this is allowing an entire test class to be ignored (e.g. to quickly deal with a flaky test) without having to modify the BUILD file. This is desirable in order to reduce the likelihood that a developer forgets to update the BUILD file when removing the `@Ignore` annotation. This pull request overrides the previous pull request https://github.com/bazelbuild/bazel/pull/4073 Closes #4293. PiperOrigin-RevId: 188850828
* Automated rollback of commit 3edf41b70de9bb1a8702d0342beeb2ad13898d71.Gravatar philwo2018-03-09
| | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollback was requested by original authors @hmemcpy and @ittaiz in #3201: "We found a problem with this patch... seems that tests that are added dynamically by the test runner (in our case, specs2 'examples' that are generated with Fragments.foreach) do not appear in the xml!" This should be part of 0.12.0-rc1, otherwise that release will have the above mentioned regression. *** Original change description *** Skipping writing FILTERED tests to test.xml This fixes #3201 by preventing tests that haven't actually run to be written to the test.xml. This is consistent with how e.g. surefire reports work, tests that were filtered out do not appear in the xml. This allows changing the Bazel plugin in such a way that does not depend on `time` being 0.0. Closes #4596. PiperOrigin-RevId: 188455315
* Rewrite visibility handling for all java_toolsGravatar ulfjack2018-02-16
| | | | PiperOrigin-RevId: 185959149
* Skipping writing FILTERED tests to test.xmlGravatar Igal Tabachnik2018-02-15
| | | | | | | | | This fixes #3201 by preventing tests that haven't actually run to be written to the test.xml. This is consistent with how e.g. surefire reports work, tests that were filtered out do not appear in the xml. This allows changing the Bazel plugin in such a way that does not depend on `time` being 0.0. Closes #4596. PiperOrigin-RevId: 185810400
* Remove the status xml attribute from AntXmlResultWriterGravatar elenairina2017-09-26
| | | | | | | | | as it was not part of a valid junit xml schema. To cherry-pick for #3286. RELNOTES: None. PiperOrigin-RevId: 170022796
* Add a global failure when a test is interrupted/cancelled.Gravatar elenairina2017-09-22
| | | | | | | | | | | When a timeout occurred, the current test case is interrupted and the others are cancelled. This was not reflected in any way and all tests were reported as success, even if there was a timeout and the tests were cancelled/interrupted. Also add a status xml attribute to mark if the test was completed, cancelled or interrupted. Fixes #3763 RELNOTES: None. PiperOrigin-RevId: 169665622
* This change adds an explicit dependency on the current Java runtime that ↵Gravatar lberki2017-08-28
| | | | | | | | indirectly depend on it by using the $(JAVABASE) or $(JAVA) Make variables. It was tested by running "bazel build --nobuild" on the affected targest to make sure that they still work. PiperOrigin-RevId: 166695324
* Auto-generate BUILD files for src/java_tools/junitrunnerGravatar ulfjack2017-08-28
| | | | | | | | | This and further changes may contain minor modifications to BUILD files that don't serve any apparent purpose. The reason for these changes is that we're switching from checked-in BUILD files to generated BUILD files, and there may be small differences between these files. PiperOrigin-RevId: 166684362
* Rewrite junitrunner integration testsGravatar ulfjack2017-08-11
| | | | | | | | | | | | Use $(location) to get the unittest.bash script, which allows this test to also run with a different label prefix. This involves removing the intermediate testenv.sh script, which doesn't seem to add much value. We might want to consider a sh_unit_test rule or macro that has an implicit dependency on the unittest.bash script and doesn't require every test to do this manually. PiperOrigin-RevId: 164846477
* sed: fall back to -r if -E does not workGravatar ulfjack2017-08-04
| | | | PiperOrigin-RevId: 164252615
* Update BUILD filesGravatar Ulf Adams2017-06-13
| | | | | | | | | | | We're currently maintaining two sets of BUILD files; one at Google, and one in the Git repository. We'd like to not do that. This change makes some of the Bazel BUILD files more closely match their counterparts, in preparation for removing the internal ones. Closes #3094. PiperOrigin-RevId: 158820490
* Migrate Java tests to Truth.Gravatar lberki2017-05-30
| | | | | | RELNOTES: None. PiperOrigin-RevId: 157446717
* Rollback of commit 786cfa2ed980e278c42ee474408844f7e3720385.Gravatar Kush Chakraborty2017-02-24
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks dagger []: [] *** Original change description *** Separate the classpaths of the TestRunner with the test target, and use a separate Classloader to load the test target's classes. This enables a clean separation of the classes of the TestRunner with the target under test. This is achieved with the following steps: 1. Start the test runner with only the bare bones classpaths to the Test Runner's classes which are used by the system ClassLoader. 2. Have all the classpaths required to load the test target's classes in a TEST_TARGET_CLASSPATH envi... *** -- PiperOrigin-RevId: 148405598 MOS_MIGRATED_REVID=148405598
* Separate the classpaths of the TestRunner with the test target, and use a ↵Gravatar Kush Chakraborty2017-02-23
| | | | | | | | | | | | | | | | | | | | | | separate Classloader to load the test target's classes. This enables a clean separation of the classes of the TestRunner with the target under test. This is achieved with the following steps: 1. Start the test runner with only the bare bones classpaths to the Test Runner's classes which are used by the system ClassLoader. 2. Have all the classpaths required to load the test target's classes in a TEST_TARGET_CLASSPATH environment variable exported by the stub script. 3. Use a new classloader to load all the test target's classes using the paths in TEST_TARGET_CLASSPATH. This additionally enables the persistent test runner (currently experimental), to reload all the target's classes for every subsequent test run, so it can pick up any changes to the classes in between runs. The persistent test runner can be used by adding the argument --test_strategy=experimental_worker to the bazel test command. Tested this against: 1. gerrit/gerrit-common:client_tests: Dismal avg. improvement of 580ms to 557ms (just 23ms) 2. intellij/intellij/base:unit_tests: Somewhat modest avg. improvement 1661ms to 913ms (748 ms) RELNOTES: 1) Java tests and suites will now have to explicitly declare JUnit dependency 2) All non-legacy java_tests will now be run in a -- PiperOrigin-RevId: 148309979 MOS_MIGRATED_REVID=148309979
* Rolling forward the change to open source JUnit integration tests.Gravatar Kush Chakraborty2017-02-23
| | | | | | | | | | | | | | | | | | | | Fixed failures by removing the (expected) failing XML reports from the path, to stop Jenkins from reporting a failure despite passing tests. After removing the XMLs I see jenkins passing where it was previously failing: http://ci.bazel.io/job/Gerrit-bazel-tests/419/ (caused by an un-clean version of this change https://bazel-review.googlesource.com/c/9039/) <Rollback history below> *** Original change description *** Automated [] rollback of commit 9822151a2ab0574b3d7a884f623b6b260258cd6b. *** Reason for rollback *** Jenkins reports the tests as failing. See #2554 for more details. -- PiperOrigin-RevId: 148268951 MOS_MIGRATED_REVID=148268951
* Rollback of commit 9822151a2ab0574b3d7a884f623b6b260258cd6b.Gravatar Irina Iancu2017-02-20
| | | | | | | | | | *** Reason for rollback *** Jenkins reports the tests as failing. See #2554 for more details. -- PiperOrigin-RevId: 148014358 MOS_MIGRATED_REVID=148014358
* Automated [] rollback of commit 53b10eabb02480111510281b776db524df490a29.Gravatar Kush Chakraborty2017-02-17
| | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolling forward after fixing Mac tests, and adding coverage to Kokoro. *** Original change description *** Automated [] rollback of commit d8eec343d238129ce8b5146c4177d207a6b3683b. *** 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
* Rollback of commit d8eec343d238129ce8b5146c4177d207a6b3683b.Gravatar Dmitry Lomov2017-02-15
| | | | | | | | | | | | | | | | | | | | | *** 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.runfiles/MANIFEST: Creating runfiles tree bazel-out/local-fastbuild/bin/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4_testbridge_integration_test.runfiles failed: build-runfiles failed: error executing command (cd /private/var/tmp/_bazel_ci/663aef0b024d9552f81e09f650e1ea55/execroot/darwin-x86_64 && \ exec env - \ PATH=/Users/ci/workspace/bazel-tests/BAZEL_VERSION/HEAD/PLATFORM_NAME/darwin-x86_64/.bin:/usr/bin:/bin:/usr/sbin:/sbin \ TMPDIR=/var/folders/3[]pdj48r577v5qqr3dqn58xq40000gn/T/ \ /private/var/tmp/_bazel_ci/663aef0b024d9552f81e09f650e1ea55/execroot/darwin-x86_64/_bin/build-runfiles bazel-out/local-fastbuild/bin/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4_testbridge_integration_test.runfiles_manifest bazel-out/local-fastbuild/bin/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4_testbridge_integration_test.runfiles) *** Original change description *** Open source the integration tests for BazelTestRunner and delete the internal versions. -- PiperOrigin-RevId: 147587929 MOS_MIGRATED_REVID=147587929
* JUnit4 now correctly labels filtered tests as "filtered".Gravatar Googler2017-02-14
| | | | | | -- PiperOrigin-RevId: 147362001 MOS_MIGRATED_REVID=147362001
* Open source the integration tests for BazelTestRunner and delete the ↵Gravatar Kush Chakraborty2017-02-14
| | | | | | | | internal versions. -- PiperOrigin-RevId: 147355493 MOS_MIGRATED_REVID=147355493
* Move the JUnit runner tests to the same location as the Internal Repo.Gravatar Kush Chakraborty2017-02-10
-- PiperOrigin-RevId: 147159416 MOS_MIGRATED_REVID=147159416