testing-junit-platform

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Remove workarounds for Vintage engine

The workaround was unnecessary since `vintageDynamicMethodName` always

returned `null` and we can then simply check the class name from the

ClassSource.

Fix executing Specs tests via JUnit Platform and Vintage engine

Prior to this commit, the JUnitPlatformTestExecutionListener parsed the

unique ID to determine the class and method name for TestIdentifiers

without children but with a ClassSource. This occurs when a Spock test

class uses `@Unroll` on all its test methods. However, other testing

frameworks such as Specs2 don't provide a unique ID that is parseable

which lead to the methodName being null which cause a failure during

serialization. The effect was that tests hung because the build VM

was waiting for the worker to finish the tests it started.

The Spock-specific workaround in our listener is now replaced with a

more robust one that always uses the methodName provided by the JUnit

Platform instead of parsing it.

  1. … 1 more file in changeset.
Change all subprojects to use 'implementation' dependencies

This includes:

- All projects now explicitly declare all dependencies to other

subprojects. This makes issues more visible, guards for accidental

addition of new dependencies, and leaks much less transitive

dependencies on the compile classpathes.

- All usages of 'runtime' to declare dependencies have been replaced

with 'runtimeOnly'

- All projects are now `java-library` (and declare this explicitly)

- Most remaining Groovy scripts are translated to Kotlin

- The old 'compile' and 'runtime' configurations are not

configured/created anymore for the 'testFixture' and 'integTest'

source sets.

- Some obsolete dependencies (see previous commits) are removed

- 'api' is used scarcely on purpose as the current project structure is

not well designed for this. The projects contain code for several

concerns of the build tool and thus putting complete projects on the

API of others exposes too much. They should be split up along

functional concerns first.

    • -0
    • +36
    ./testing-junit-platform.gradle.kts
  1. … 111 more files in changeset.
Make more subprojects use Java 8 and remove redundant module types (#9447)

  1. … 28 more files in changeset.
Fix handling of aborted containers with completed children

When a container `TestIdentifier` was reported as finished, we reported

all of its children as skipped, regardless whether they already had been

completed previously. Now, we only report unstarted children as skipped.

Resolves #8685.

  1. … 5 more files in changeset.
Remove race condition

Polishing

  1. … 6 more files in changeset.
Add support for executing test classes in parallel via JUnit Platform

Fixes #6453.

  1. … 10 more files in changeset.
Add support for excluding tests via --excludeTests

Signed-off-by: Felipe Lima <felipe.lima@gmail.com>

  1. … 13 more files in changeset.
Set IntelliJ language level to Java 8 for all modules

  1. … 2 more files in changeset.
Revert "Exclude anonymous class in JUnit Platform (#4774)"

This reverts commit abeb7ebb9e3cb17c826ad40caac6a54480beccad.

  1. … 3 more files in changeset.
Exclude anonymous class in JUnit Platform (#4774)

This fixes https://github.com/gradle/gradle/issues/4544 https://github.com/gradle/gradle/issues/4618

Previously we send anonymous class to JUnit Platform test worker, which caused some issues.

Now they're excluded by name pattern .*\$\d+

  1. … 3 more files in changeset.
Convert dependency management related subprojects to kotlin-dsl (#4498)

This PR also fixes the dependency declarations wrt. api/impl separation

for these and related projects.

It fixes two places in production/test code where dependencies

leaked into the classpath and the wrong classes where imported.

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

  1. … 33 more files in changeset.
Introduced the property moduleType to derive source compatibility settings

  1. … 80 more files in changeset.
Ignore test class only when it's a class inside @Nested class

This fixes https://github.com/gradle/gradle/issues/4427

Previously we only pass top-level classes to JUnit 5, which might cause

issues. This PR fixes this behaviour: only ignore classes inside @Nested

class.

  1. … 3 more files in changeset.
Handle exceptions in JUnit 5 test engine initialization

This fixes https://github.com/gradle/gradle/issues/4476

Previously in Gradle, test execution are class-based, which means a "TestClassStart" event will

be emitted before all test cases and a "TestClassEnd" event will be emitted after all test cases

(no matter they're failed or successful). In JUnit 5, if an exception occurs before "TestClassStart"

event (e.g. exceptions in test engine initialization), some event assertions will be violated.

In this situation, this PR will emit corresponding "TestClassStart/TestClassEnd" event to make

Gradle test event infrastructure happy.

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

  1. … 60 more files in changeset.
Fix bugs when integrating with running Vintage engine on Spock @Unroll test

Vintage engine will trigger events with type 'TEST' for both test class

and test method, which might cause test hang unexpectedly. This PR identifies

these different test events and fixes this issue.

  1. … 1 more file in changeset.
Ignore nested class in JUnit platform test

  1. … 2 more files in changeset.
Polish PR on feedback

  1. … 13 more files in changeset.
Fix NPE when using custom test engine

  1. … 1 more file in changeset.
Polish PR on feedback

  1. … 8 more files in changeset.
Run all tests in one pass

Fix failed tests

  1. … 6 more files in changeset.
Refine release note and userguide

  1. … 22 more files in changeset.
Add filtering and tagging support

  1. … 21 more files in changeset.
Minor changes for review

  1. … 5 more files in changeset.
Scan for both JUnit 4 and 5 classes

  1. … 47 more files in changeset.