DefaultTestExecutionResult.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
    • +30
    ./DefaultTestExecutionResult.groovy
  1. … 18 more files in changeset.
Polish support for `@DisplayName` in tests

In particular, remove the need to pass a `hasDisplayNameAnnotation` flag

around, which is too specific for the test descriptors.

  1. … 14 more files in changeset.
Merge branch 'master' of https://github.com/dhirabayashi/gradle into dhirabayashi-master

    • -4
    • +30
    ./DefaultTestExecutionResult.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.

  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.

  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.

  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
    • +30
    ./DefaultTestExecutionResult.groovy
  1. … 23 more files in changeset.
Add a functional test suite to the Gradle plugin builds generated by the build init plugin.

  1. … 13 more files in changeset.
Add a functional test suite to the Gradle plugin builds generated by the build init plugin.

  1. … 13 more files in changeset.
Add a functional test suite to the Gradle plugin builds generated by the build init plugin.

  1. … 13 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<>

  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
    • +24
    ./DefaultTestExecutionResult.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

    • -0
    • +19
    ./DefaultTestExecutionResult.groovy
  1. … 41 more files in changeset.
Minor changes for review

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

    • -7
    • +18
    ./DefaultTestExecutionResult.groovy
  1. … 10 more files in changeset.
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
    ./DefaultTestExecutionResult.groovy
  1. … 11 more files in changeset.
Fix some tests that rely on a test executor with a specific ID

  1. … 14 more files in changeset.
include task name in test report/result folder when using java plugin

  1. … 11 more files in changeset.
Make sure that we have a separate report directory for each binary variant of the component under test

Story: gradle/langos#113

  1. … 3 more files in changeset.
Simplified construction of JUnitXmlTestExecutionResult in tests

  1. … 3 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

  1. … 8 more files in changeset.
Changed some int tests to use DefaultTestExecutionResult rather than JUnitTestExecutionResult, to use whatever the default mechanism for verifying test results happens to be.

  1. … 24 more files in changeset.
Changed the HtmlTestExecutionResult assert methods so that they actually assert stuff, and some other minor fixes in the various TestExecutionResult implementations.

  1. … 3 more files in changeset.
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.

  1. … 17 more files in changeset.
REVIEW-1310:

- wrap HtmlTestExecutionResult and JUnitXmlTestExecutionResult in DefaultTestExecutionResult

- fix HtmlTestExecutionResult

- always add testclass to report

    • -0
    • +98
    ./DefaultTestExecutionResult.groovy
  1. … 3 more files in changeset.
REVIEW-1033: rename DefaultTestExecutionResult to JUnitXmlTestExecutionResult

    • -184
    • +0
    ./DefaultTestExecutionResult.groovy
  1. … 29 more files in changeset.
Some renaming and cleanup around the test/temp directory used in tests.

  1. … 308 more files in changeset.
REVIEW-867: Rename test fixture JUnitTestExecutionResult -> DefaultTestExecutionResult.

    • -0
    • +184
    ./DefaultTestExecutionResult.groovy
  1. … 27 more files in changeset.