Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Remove resource deadlock detection from build operation infrastructure, as it makes assumptions that are no longer true and does not belong at this level.

  1. … 8 more files in changeset.
Move failure diagnostics to test report

  1. … 9 more files in changeset.
Fix NPE in RestartEveryNTestClassProcessor.stopNow() (#5145)

* Fix NPE in RestartEveryNTestClassProcessor.stopNow()

* Add test verifying RestartEveryNTestClassProcessor.stopNow() after stop() does nothing

  1. … 1 more file in changeset.
Make ClassMethodNameStackTraceSpec support anonymous class matching (#4797)

Make ClassMethodNameStackTraceSpec support anonymous class matching

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

Previously, when TestExceptionFormatter formats test stacktraces, it tries to

find the exactly matched class/method name as stacktrace truncation point.

However, some kotlin-based tests have only anonymous classes in their stacktraces,

which makes it impossible to find the exact truncation point. This PR treats

`SomeClass$1$1$1` and `SomeClass` equally when performing class name matching.

  1. … 1 more file 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. … 32 more files in changeset.
Improves --tests pattern matching (#4597)

We improve test pattern matching in this PR. From this PR, the test pattern matching

rule are adjusted:

- If a pattern starts with an upper-case letter, it will be used to match simple class name

e.g 'TestClass.testMethod' can match 'TestClass.testMethod' under any package.

- Otherwise, it will be used to match full qualified name.

In both cases, wildcards are supported.

  1. … 12 more files in changeset.
Run previous failed test first (#4557)

Run previous failed test first

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

Before the test starts, we collect all failed test classes from the result of last test, and

send them to test worker process first - this is transparent to test infrastructure because

we didn't make any guarantee about test class execution order previously.

  1. … 8 more files in changeset.
Emit build operation progress events for logging output (#4537)

* Tweak BuildOperationListener#progress api

* Use build operation id to reference progress

* Add workaround for tracing log output via build operation progress for composite builds

* Replace some Object typing of operation identifiers with OperationIdentifier.

* Associate all progress logging with the current build operation.

* Update logic to accommodate for all progress events now having build operation IDs.

* Don't allow ProgressStartEvent.buildOperationCategory to be null.

** Default it to uncategorized.

  1. … 50 more files in changeset.
Rationalise handling of “current” build operation and build operation ID

For an upcoming change to emit console logging as build operation progress events, we need to associate all progress logging with the build operation. This pulled a thread on some long overdue cleanup.

The end result is:

1. Base build operation infrastructure is consolidated org.gradle.internal.operations.

2. Mechanism for passing thread global current build operation is more test friendly, and better named.

3. A consistent mechanism is used for binding the current operation to the thread, instead of two mechanisms.

4. Build operation IDs are typed to OperationIdentifier.

There is no public API or user behaviour change.

  1. … 145 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. … 37 more files in changeset.
Fix failed tests

Fix failures on CI

  1. … 13 more files in changeset.
Add --warning to suppress deprecation warnings (#3726)

Signed-off-by: Bo Zhang <bo@gradle.com>

  1. … 31 more files in changeset.
Catch AccessControlException to avoid test worker process hanging

Partially fix https://github.com/gradle/gradle/issues/3526

If a security manager is set in test, test worker process can no longer

react to message from main process because Gradle's message dispatch mechanism

depends on reflection and socket communication. This PR fix the issue which cause

worker process to hang and provide more readable error messages

Signed-off-by: Bo Zhang <bo@gradle.com>

  1. … 6 more files in changeset.
Introduce build operation progress events, only used for conveying test output to build scans currently.

  1. … 22 more files in changeset.
Move the test build operation classes to a dedicated package.

  1. … 11 more files in changeset.
don't rely on BuildOperationExecutor#currentOperation

  1. … 2 more files in changeset.
category type removed from test related build ops

Move TestListenerBuildOperationAdapterTest to internal package and make it package private

  1. … 6 more files in changeset.
introduce TestingBasePluginServiceRegistry providing TestListenerBuildOperationAdapter

  1. … 4 more files in changeset.
Address review feedback

- expose root test executor via build op

- further cleanup

  1. … 21 more files in changeset.
Enable test reporting for all instances of AbstractTestTask

  1. … 64 more files in changeset.
Expose test and test output events as build operations

    • -0
    • +132
    ./gradle/api/tasks/testing/TestListenerBuildOperationAdapterTest.groovy
  1. … 18 more files in changeset.
Strive to keep Gradle's monotonic clock in sync with the system clock

  1. … 71 more files in changeset.
Simplify time handling internally and for build scans (#2857)

* Don't make TimeProvider Serializable.

This isn't safe and generally doesn't make sense.

* Extract and promote the concept of a build timer.

This was previously not well defined and being overlaid with the concept of when a user/tool requested something, which is not always the same thing.

* Pare down the deprecated org.gradle.util.Clock down to the minimum required.

Internal usage is replaced by a `getStartTime()` directly on BuildRequestContext.

What is left is only kept for backwards compatibility with scans.

* Rename TimeProvider to Clock.

* Move BuildExecutionTimer out of baseServices into core, and into a better package.

* Remove unused.

* Simplify the time package by merging types.

* Prevent the client's build started timestamp from being later than when the provider received the build request.

* Provide a dedicated mechanism for conveying the build start time to build scans.

* Consolidate the ways of formatting durations.

  1. … 177 more files in changeset.
Fix test

Fix parallel test execution rendering with TestNG in console (#2787)

  1. … 5 more files in changeset.
Extract :core-api project (#2719)

  1. … 785 more files in changeset.
Use a common `ReliableTimeProvider` for test execution

- For external process, WorkerServices registry has a reliable TimeProvider

- For client side, use TimeProvider build process

  1. … 5 more files in changeset.
Abbreviate long qualified test classes when displaying in console

Omit the middle packages of a long test class name. For example:

org.gradle.api.internal.tasks.testing.logging.TestWorkerProgressListenerTest

becomes

org.gradle...testing.logging.TestWorkerProgressListenerTest

Issue: #2547

  1. … 4 more files in changeset.