New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add integ test for closure-based listeners in AbstractTestTask #26210
Add integ test for closure-based listeners in AbstractTestTask #26210
Conversation
which were not working before 8.4. Issue: #25311
@@ -72,4 +72,48 @@ abstract class AbstractJUnit4TestListenerIntegrationTest extends AbstractJUnitTe | |||
assert containsLine(result.getOutput(), "START [Test testError(SomeTest)] [testError]") | |||
assert containsLine(result.getOutput(), "FINISH [Test testError(SomeTest)] [testError] [java.lang.RuntimeException: message]") | |||
} | |||
|
|||
def "can listen for test events using closures"() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now works in master, but it would fail with the CC-enabled executer in 8.3 (I applied this commit to a local copy of the release branch, and got this:
Condition not satisfied:
containsLine(result.getOutput(), "START [Test class SomeTest] [SomeTest]")
| | |
false | > Task :processTestResources NO-SOURCE
| > Task :processResources NO-SOURCE
| > Task :compileJava NO-SOURCE
| > Task :classes UP-TO-DATE
| > Task :compileTestJava
| > Task :testClasses
|
| > Task :test
|
| SomeTest > testError FAILED
| java.lang.RuntimeException at SomeTest.java:17
|
| SomeTest > testFail FAILED
| java.lang.AssertionError at SomeTest.java:15
| There were failing tests. See the report at: file:///Users/rafael/sources/gradle/trees/release/subprojects/testing-jvm/build/tmp/te%C5%9Dt%20files/JUnit4TestL.Test/t9b6w/build/reports/tests/test/index.html
|
| BUILD SUCCESSFUL in 823ms
| 2 actionable tasks: 2 executed
| Configuration cache entry stored.
<org.gradle.integtests.fixtures.executer.OutputScrapingExecutionResult@204b0f07 output=[> Task :processTestResources NO-SOURCE, > Task :processResources NO-SOURCE, > Task :compileJava NO-SOURCE, > Task :classes UP-TO-DATE, > Task :compileTestJava, > Task :testClasses, , > Task :test, , SomeTest > testError FAILED, java.lang.RuntimeException at SomeTest.java:17, , SomeTest > testFail FAILED, java.lang.AssertionError at SomeTest.java:15, There were failing tests. See the report at: file:///Users/rafael/sources/gradle/trees/release/subprojects/testing-jvm/build/tmp/te%C5%9Dt%20files/JUnit4TestL.Test/t9b6w/build/reports/tests/test/index.html, , BUILD SUCCESSFUL in 823ms, 2 actionable tasks: 2 executed, Configuration cache entry stored., ] error=[, 3 tests completed, 2 failed, ] includeBuildSrc=true mainContent=[> Task :processTestResources NO-SOURCE, > Task :processResources NO-SOURCE, > Task :compileJava NO-SOURCE, > Task :classes UP-TO-DATE, > Task :compileTestJava, > Task :testClasses, , > Task :test, , SomeTest > testError FAILED, java.lang.RuntimeException at SomeTest.java:17, , SomeTest > testFail FAILED, java.lang.AssertionError at SomeTest.java:15, There were failing tests. See the report at: file:///Users/rafael/sources/gradle/trees/release/subprojects/testing-jvm/build/tmp/te%C5%9Dt%20files/JUnit4TestL.Test/t9b6w/build/reports/tests/test/index.html, ] postBuild=[2 actionable tasks: 2 executed, Configuration cache entry stored., ] errorContent=[, 3 tests completed, 2 failed, ] groupedOutputFixture=null tasks=null>
at org.gradle.testing.junit.junit4.AbstractJUnit4TestListenerIntegrationTest.can listen for test events using closures(AbstractJUnit4TestListenerIntegrationTest.groovy:110)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean the closure-based listeners aren't running at all? Are they broken?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Often, yes. It was very non-deterministic. We originally tried serialize/deserialize an object tree (ListenerBroadcast
) that was built up lazily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, we are talking about configuration cache behavior.
@bot-gradle test and merge |
Your PR is queued. See the queue page for details. |
...which were not working before 8.4.
Issue: #25311, #25983