Do not run smoke test servers when tests are disabled
Unfortunately Gradle seem to need some manual help to figure this one out.
MODIFY
dd-smoke-tests/play/play.gradle
dd-smoke-tests/play/play.gradle
@@ -87,6 +87,9 @@ tasks.register("startServer", com.github.psxpaul.task.ExecFork) {
]
dependsOn 'stage'
+
+ // When tests are disabled this would still be run, so disable this manually
+ onlyIf { !project.rootProject.hasProperty("skipTests") }
}
tasks.register("deletePIDFile") {

MODIFY
dd-smoke-tests/springboot/springboot.gradle
dd-smoke-tests/springboot/springboot.gradle
@@ -50,6 +50,9 @@ tasks.register("startServer", com.github.psxpaul.task.ExecFork) {
waitForOutput = "datadog.smoketest.springboot.SpringbootApplication - Started SpringbootApplication"
timeout = 240
stopAfter = test
+
+ // When tests are disabled this would still be run, so disable this manually
+ onlyIf { !project.rootProject.hasProperty("skipTests") }
}
tasks.withType(Test).configureEach {

MODIFY
dd-smoke-tests/wildfly/wildfly.gradle
dd-smoke-tests/wildfly/wildfly.gradle
@@ -50,6 +50,9 @@ tasks.register("unzip", Copy) {
} else {
throw new GradleException("Can't find server zip file that starts with: " + zipFileNamePrefix)
}
+
+ // When tests are disabled this would still be run, so disable this manually
+ onlyIf { !project.rootProject.hasProperty("skipTests") }
}
tasks.register("startServer", com.github.psxpaul.task.ExecFork) {
@@ -83,6 +86,9 @@ tasks.register("startServer", com.github.psxpaul.task.ExecFork) {
]
dependsOn unzip
+
+ // When tests are disabled this would still be run, so disable this manually
+ onlyIf { !project.rootProject.hasProperty("skipTests") }
}
tasks.register("stopWildfly", Exec) {
@@ -92,6 +98,9 @@ tasks.register("stopWildfly", Exec) {
args = ["--connect", "--controller=localhost:${wildflyManagementPort}", "command=:shutdown"]
dependsOn startServer
+
+ // When tests are disabled this would still be run, so disable this manually
+ onlyIf { !project.rootProject.hasProperty("skipTests") }
}
tasks.withType(Test).configureEach {

MODIFY
gradle/java.gradle
gradle/java.gradle
@@ -302,10 +302,8 @@ for (def env : System.getenv().entrySet()) {
}
// Disable all tests if skipTests property was specified
-if (project.hasProperty("skipTests")) {
tasks.withType(Test).configureEach {
- onlyIf { false }
- }
+ onlyIf { !project.rootProject.hasProperty("skipTests") }
}
plugins.withType(BasePlugin) {

Do not run smoke test servers when tests are disabled

Unfortunately Gradle seem to need some manual help to figure this one out.