Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Detect special multicause exceptions

This commit fixes an issue where test reports and build scans didn't capture

all the causes of an exception, in case the "multi-cause" exception isn't

a type known of the daemon. By that, we mean a type which is not available

at runtime in the daemon process, but is used in the worker process.

Typically, the `org.opentest4j.MultipleFailuresError` type used by

JUnit is such an example: the type is used in a test process, but

not loaded in Gradle. In such cases, Gradle builds a placeholder

exception type which collects the root cause. But in case the

exception is actually collecting multiple causes like in this test

class, Gradle lost some information in the process.

Therefore, this commit introduces a heuristic to figure out if an

exception is collecting multiple causes instead of a single one.

The heuristic is kept very simple: one has to find a method which

name is either `getCauses` (like for Gradle's own default multi

cause exception) or `getFailures` (like in opentest4j), and it

has to return a collection of failures.

This will not fix all problems but it should capture a good amount

of them.

Fixes #9487

    • -2
    • +3
    ./fixtures/HtmlTestExecutionResult.groovy
  1. … 3 more files in changeset.
Detect special multicause exceptions

This commit fixes an issue where test reports and build scans didn't capture

all the causes of an exception, in case the "multi-cause" exception isn't

a type known of the daemon. By that, we mean a type which is not available

at runtime in the daemon process, but is used in the worker process.

Typically, the `org.opentest4j.MultipleFailuresError` type used by

JUnit is such an example: the type is used in a test process, but

not loaded in Gradle. In such cases, Gradle builds a placeholder

exception type which collects the root cause. But in case the

exception is actually collecting multiple causes like in this test

class, Gradle lost some information in the process.

Therefore, this commit introduces a heuristic to figure out if an

exception is collecting multiple causes instead of a single one.

The heuristic is kept very simple: one has to find a method which

name is either `getCauses` (like for Gradle's own default multi

cause exception) or `getFailures` (like in opentest4j), and it

has to return a collection of failures.

This will not fix all problems but it should capture a good amount

of them.

Fixes #9487

    • -2
    • +3
    ./fixtures/HtmlTestExecutionResult.groovy
  1. … 3 more files in changeset.
Merge branch 'master' into master

    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 8 more files in changeset.
If @DisplayName annotation is attached, output the annotation value to name attribute of testsuite and name attribute of testcase. If @DisplayName annotation is not attached, output the class FQN. In any case, output the class FQN to classname attribute of testcase.

Issue: #11445

Signed-off-by: Daiki Hirabayashi <hirabayashi@infoscience.co.jp>

    • -4
    • +30
    ./fixtures/DefaultTestExecutionResult.groovy
    • -4
    • +14
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -2
    • +2
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 21 more files in changeset.
Upgrade JUnit version (#12924)

Upgrade JUnit to 4.13, JUnit platform to 5.6.2

    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 331 more files in changeset.
Upgrade JUnit

    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 330 more files in changeset.
Fix more

    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 89 more files in changeset.
Introduce global Spock rule to work around bug with JUnit rule ordering

See https://github.com/spockframework/spock/issues/1050

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -0
    • +59
    ./fixtures/FixSpockJUnitRulesOrderExtension.groovy
  1. … 1 more file in changeset.
Replace 'Matchers' with 'CoreMatchers'

So we do not require 'org.hamcrest:hamcrest-library' as additional

dependency anymore. Which was only available for most of the tests

because it leaked onto the test compile classpath.

    • -27
    • +27
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 161 more files in changeset.
Use 'implementation' dependencies everywhere

    • -27
    • +27
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 285 more files in changeset.
Use 'implementation' dependencies everywhere

    • -27
    • +27
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 282 more files in changeset.
Use 'implementation' dependencies everywhere

    • -27
    • +27
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 285 more files in changeset.
Use 'implementation' dependencies everywhere

    • -20
    • +20
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 283 more files in changeset.
Use 'implementation' dependencies everywhere

    • -27
    • +27
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 284 more files in changeset.
Use 'implementation' dependencies everywhere

    • -27
    • +27
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -1
    • +1
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 284 more files in changeset.
Add a functional test suite to the Gradle plugin builds generated by the build init plugin.

    • -1
    • +1
    ./fixtures/DefaultTestExecutionResult.groovy
  1. … 13 more files in changeset.
Add a functional test suite to the Gradle plugin builds generated by the build init plugin.

    • -1
    • +1
    ./fixtures/DefaultTestExecutionResult.groovy
  1. … 13 more files in changeset.
Add a functional test suite to the Gradle plugin builds generated by the build init plugin.

    • -1
    • +1
    ./fixtures/DefaultTestExecutionResult.groovy
  1. … 13 more files in changeset.
Add support for executing test classes in parallel via JUnit Platform

Fixes #6453.

    • -0
    • +2
    ./fixtures/HtmlTestExecutionResult.groovy
  1. … 12 more files in changeset.
Update jsoup to 1.11.3

jsoup no longer converts Windows line separators to Unix ones. Thus, a

few test reporting test fixtures had to be adjusted.

    • -8
    • +10
    ./fixtures/HtmlTestExecutionResult.groovy
  1. … 5 more files in changeset.
Make xctest fatal errors only fail the test and change execution failure test name

    • -1
    • +1
    ./fixtures/HtmlTestExecutionResult.groovy
    • -1
    • +2
    ./fixtures/JUnitTestClassExecutionResult.groovy
  1. … 5 more files in changeset.
Ensure that all children TestState are completed() (#4752)

* Ensure that all children TestState are completed()

With fail fast for tests enabled, some of the `TestState`s tracked

by the `StateTrackingTestResultProcessor` may never receive the

`completed()` call. When this happens, the parent/ancester

`TestState` will not include the test count and failure information.

When combined with a `--tests` filter, this can cause an erroneous

failure message that no tests matched the filter.

This change ensures that all of the children/descendents of a `testId`

(`TestState`) are `completed` before the given `testId` is processed.

Addresses: #4718

* Use ArrayList<> instead of LinkedList<>

    • -0
    • +9
    ./fixtures/DefaultTestExecutionResult.groovy
    • -0
    • +4
    ./fixtures/HtmlTestExecutionResult.groovy
    • -0
    • +6
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -0
    • +2
    ./fixtures/TestClassExecutionResult.java
  1. … 4 more files in changeset.
Add displayName and classDisplayName to TestDescriptor (#4425)

Add displayName and classDisplayName to TestDescriptor

This fixes https://github.com/gradle/gradle/issues/4424 and https://github.com/gradle/gradle/issues/4423

JUnit 5 introduces @DisplayName and dynamic tests, which allows users to

customize test case and test class' name. This should be taken into

account. This PR introduces `displayName` and `classDisplayName` which are

used for display. When rendering HTML reports, these two fields will be used.

    • -0
    • +24
    ./fixtures/DefaultTestExecutionResult.groovy
    • -36
    • +85
    ./fixtures/HtmlTestExecutionResult.groovy
    • -0
    • +19
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -1
    • +8
    ./fixtures/TestClassExecutionResult.java
  1. … 30 more files in changeset.
Stop test execution after first failure (#4190)

* Rough pass at stopNow() on test failure

* Updated worker TestClassProcessor.stopNow() to throw UnsupportedOperationException

* Updated MaxNParallelTestClassProcessor to keep "raw" processors for stopNow().

Updated other daemon-side TestClassProcessors to keep track if stopNow() is called.

* Added AbstractTestTask.getFailFast()

* Added some unit tests for to TestClassProcessors

* Added unit tests for stopNow()

* Rough pass at JUnitFailFastIntegrationTest

* Refactor fail fast JVM integration test.

Moved common logic/tests from JUnitFailFastIntegrationTest into AbstractJvmFailFastIntegrationSpec.

Added TestNGFailFastIntegrationTest (which extends TestNGFailFastIntegrationTest)

* Working on forkEvery fail fast test

* Converted FailFastTestListener to FailFastTestListenerInternal

* Added BlockingHttpServer.expectMaybeAndBlock()

* TestNG parallel & fail-fast integration test

* Remove unused import

* Remove unused import

* Marked test.failFast as @Input

* Added `failFast` to java_plugin in userguide

* Javadoc & formatting changes

* Updated userguide docs based on review comments

* Moved `failFast` configuration from `AbstractTestTask` to `Test` to avoid `XCTest`

* Updates from review comments

* More updates from review comments

* Reduced Mock() usage in FailFastTestListenerInternalTest

* Backed out changes to XCTestExecuter for fail fast behavior

* Fixed typo in javadoc

* Remove --no-fail-fast `@Option` from `Test`

* Reduce mocking expectations in ForkingTestClassProcessorTest

* Moved @Internal from Test.getFailFast() to AbstractTestTask

* Formatting updates

* Updated ForkingTestClassProcessor to track state more precisely to avoid stop() & stopNow() problem

* Fixed tests (again)

* Better handling of mutual exclusion between ForkingTestClassProcessor stop() and stopNow() sections

* Improved resiliency to indeterminate generated test class execution in fail fast tests

* Optimized imports

* Updated DefaultWorkerProcess.cleanup() to stop the Stoppables before aborting the execHandle

* Changed CyclicBarrierAnyOfRequestHandler.expected back to `private`

* ForkingTestClassProcessor.stoppedNow does not need to be `volatile` as it is now protected by a lock

* Added JUnitPlatformTestClassProcessor.stopNow()

* Removed mention of --no-fail-fast from user guide

* Added info on --fail-fast to release notes

* Fixed use of `testOmitted` in AbstractJvmFailFastIntegrationSpec

* Make MaxNParallelTestClassProcessor drop any processTestClass() invocations after stopNow()

* Protected critical region in ForkingTestClassProcessor.processTestClass() causing race condition with stopNow() in tests

* Debugging cleanup

    • -0
    • +19
    ./fixtures/DefaultTestExecutionResult.groovy
    • -0
    • +25
    ./fixtures/HtmlTestExecutionResult.groovy
    • -1
    • +25
    ./fixtures/JUnitTestClassExecutionResult.groovy
    • -0
    • +5
    ./fixtures/JUnitXmlTestExecutionResult.groovy
    • -0
    • +7
    ./fixtures/TestClassExecutionResult.java
  1. … 36 more files in changeset.
Minor changes for review

    • -10
    • +10
    ./fixtures/DefaultTestExecutionResult.groovy
    • -5
    • +5
    ./fixtures/HtmlTestExecutionResult.groovy
    • -2
    • +2
    ./fixtures/JUnitTestClassExecutionResult.groovy
  1. … 3 more files in changeset.
Fix failed test after using "Display Name" in Junit 5

    • -7
    • +18
    ./fixtures/DefaultTestExecutionResult.groovy
    • -5
    • +7
    ./fixtures/HtmlTestExecutionResult.groovy
    • -4
    • +6
    ./fixtures/JUnitTestClassExecutionResult.groovy
  1. … 8 more files in changeset.
Simplify a test where clause

    • -1
    • +3
    ./fixtures/HtmlTestExecutionResult.groovy
  1. … 1 more file in changeset.
Merge branch 'sg/native/xctest-coverage'

* sg/native/xctest-coverage:

Fix test

Fix test breakages that expected to be able to write into the HTML report directory

Add more test coverage for XcTest and testing frameworks

    • -0
    • +5
    ./fixtures/JUnitXmlTestExecutionResult.groovy
Add more test coverage for XcTest and testing frameworks

- When a test class is removed, make sure the intermediate report files are also removed.

- When no tests are found, make sure the test results have no classes listed.

- When tests are executed, make sure that only those tests are included in the report.

- When a test fails, make sure the failure is included in the report.

    • -2
    • +14
    ./fixtures/DefaultTestExecutionResult.groovy
    • -1
    • +11
    ./fixtures/HtmlTestExecutionResult.groovy
    • -0
    • +5
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 8 more files in changeset.
Fix scraping of XcTest output when test suite or test names have non-alphanum characters

    • -5
    • +4
    ./fixtures/JUnitXmlTestExecutionResult.groovy
  1. … 3 more files in changeset.