Skip to content

Commit cc2a5f8

Browse files
committed
Adjust assertion to accommodate Gradle 9 behavior
Signed-off-by: Pavlo Shevchenko <[email protected]>
1 parent 8a5a446 commit cc2a5f8

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

plugin/src/test/groovy/org/gradle/testretry/testframework/TestNGPlainFuncTest.groovy

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@
1515
*/
1616
package org.gradle.testretry.testframework
1717

18+
import org.gradle.util.GradleVersion
19+
1820
import javax.annotation.Nullable
1921

2022
class TestNGPlainFuncTest extends BaseTestNGFuncTest {
23+
24+
private static final GradleVersion GRADLE_9 = GradleVersion.version("9.0")
25+
2126
@Override
2227
String reportedLifecycleMethodName(String gradleVersion, TestNGLifecycleType lifecycleType, String methodName) {
2328
methodName
@@ -60,9 +65,17 @@ class TestNGPlainFuncTest extends BaseTestNGFuncTest {
6065
def result = gradleRunner(gradleVersion as String).buildAndFail()
6166
6267
then:
63-
with(result.output) {
64-
it.contains('There were failing tests. See the report')
65-
!it.contains('The following test methods could not be retried')
68+
if (GradleVersion.version(gradleVersion) < GRADLE_9) {
69+
with(result.output) {
70+
it.contains('There were failing tests. See the report')
71+
!it.contains('The following test methods could not be retried')
72+
}
73+
} else {
74+
with(result.output) {
75+
// Gradle 9 detects this as a fatal test framework error
76+
it.contains('Could not complete execution for Gradle Test Executor')
77+
!it.contains('The following test methods could not be retried')
78+
}
6679
}
6780
6881
where:

0 commit comments

Comments
 (0)