Skip to content

Commit f132c86

Browse files
authored
Fix flaky test configuration (#9918)
1 parent 54da873 commit f132c86

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

buildSrc/src/main/kotlin/datadog.configure-tests.gradle.kts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,15 @@ tasks.named("check") {
102102

103103
tasks.withType<Test>().configureEach {
104104
// Flaky tests management for JUnit 5
105-
if (testFramework is JUnitPlatformOptions) {
106-
val junitPlatform = testFramework as JUnitPlatformOptions
105+
(options as? JUnitPlatformOptions)?.apply {
107106
if (skipFlakyTestsProvider.isPresent) {
108-
junitPlatform.excludeTags("flaky")
107+
excludeTags("flaky")
109108
} else if (runFlakyTestsProvider.isPresent) {
110-
junitPlatform.includeTags("flaky")
109+
includeTags("flaky")
111110
}
112111
}
113112

114-
// Flaky tests management for Spock
113+
// Set system property flag that is checked from tests to determine if they should be skipped or run
115114
if (skipFlakyTestsProvider.isPresent) {
116115
jvmArgs("-Drun.flaky.tests=false")
117116
} else if (runFlakyTestsProvider.isPresent) {

0 commit comments

Comments
 (0)