JUnitTestClassExecutionResult.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Add support for test `@DisplayName` (#13250)

If @DisplayName annotation is attached, output the value to test result XML.

* Recognize contributor

* Add missing `@UsedByScanPlugin` annotations

Co-authored-by: Daiki Hirabayashi <hirabayashi@infoscience.co.jp>

Co-authored-by: Daiki Hirabayashi <gigabowser@hotmail.co.jp>

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

    • -4
    • +14
    ./JUnitTestClassExecutionResult.groovy
  1. … 18 more files in changeset.
Merge branch 'master' of https://github.com/dhirabayashi/gradle into dhirabayashi-master

    • -4
    • +14
    ./JUnitTestClassExecutionResult.groovy
  1. … 3 more files in changeset.
Add support for serialization of suppressed exceptions

This change serializes the Java 7+ suppressed exceptions similarly

to exception causes. This means that we would try to deserialize

known exceptions and if it's not possible, for example because the

suppressed exception is a custom exception type, then we fallback

on the placeholder exception type.

    • -3
    • +3
    ./JUnitTestClassExecutionResult.groovy
  1. … 5 more files in changeset.
Add support for serialization of suppressed exceptions

This change serializes the Java 7+ suppressed exceptions similarly

to exception causes. This means that we would try to deserialize

known exceptions and if it's not possible, for example because the

suppressed exception is a custom exception type, then we fallback

on the placeholder exception type.

    • -3
    • +3
    ./JUnitTestClassExecutionResult.groovy
  1. … 5 more files in changeset.
Add support for serialization of suppressed exceptions

This change serializes the Java 7+ suppressed exceptions similarly

to exception causes. This means that we would try to deserialize

known exceptions and if it's not possible, for example because the

suppressed exception is a custom exception type, then we fallback

on the placeholder exception type.

    • -3
    • +3
    ./JUnitTestClassExecutionResult.groovy
  1. … 5 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
    • +14
    ./JUnitTestClassExecutionResult.groovy
  1. … 23 more files 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
    ./JUnitTestClassExecutionResult.groovy
  1. … 162 more files in changeset.
Use 'implementation' dependencies everywhere

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

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

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

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

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

    • -27
    • +27
    ./JUnitTestClassExecutionResult.groovy
  1. … 285 more files in changeset.
Make xctest fatal errors only fail the test and change execution failure test name

    • -1
    • +2
    ./JUnitTestClassExecutionResult.groovy
  1. … 7 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
    • +6
    ./JUnitTestClassExecutionResult.groovy
  1. … 7 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
    • +19
    ./JUnitTestClassExecutionResult.groovy
  1. … 33 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

    • -1
    • +25
    ./JUnitTestClassExecutionResult.groovy
  1. … 41 more files in changeset.
Minor changes for review

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

    • -4
    • +6
    ./JUnitTestClassExecutionResult.groovy
  1. … 10 more files in changeset.
Fail test execution when non-default config failure policy is used with a TestNG version that doesn't support it

+review REVIEW-5274

    • -0
    • +13
    ./JUnitTestClassExecutionResult.groovy
  1. … 8 more files in changeset.
Modified JUnitTestClassExecutionResult to support the changes made in JUnitXmlResultWriter.

- Overloaded `assertTestCount` with a 4 integer function that asserts the skip count.

- Changed assert methods to filter on the existence(or not) of a `skipped` sub-element.

- Added an assert to the checking method to check that there is a skipped annotation and that is not empty.

- Removed findIgnoredTests as it is no longer required.

    • -8
    • +16
    ./JUnitTestClassExecutionResult.groovy
GRADLE-2730 Added an integ test.

    • -0
    • +5
    ./JUnitTestClassExecutionResult.groovy
  1. … 1 more file in changeset.
Improve assertions on JUnit XML output to test that no system-out type elements are present when not using test case output association.

    • -4
    • +3
    ./JUnitTestClassExecutionResult.groovy
Enabled generating the JUnit XML file with output per test case.

This is not complete. The actual generation of the XML based on the TestResultsProvider is unit tested and there is functional level coverage when running TestNG tests.

Coverage for JUnit is needed, as well as coverage at the intermediary parts of the results/report generation.

There are also some types to tidy up.

    • -0
    • +161
    ./JUnitTestClassExecutionResult.groovy
  1. … 17 more files in changeset.