Do not run smoke test servers when tests are disabled
Unfortunately Gradle seem to need some manual help to figure this one out.
This commit is contained in:
parent
4a8bea4602
commit
6b6668826d
|
@ -87,6 +87,9 @@ tasks.register("startServer", com.github.psxpaul.task.ExecFork) {
|
||||||
]
|
]
|
||||||
|
|
||||||
dependsOn 'stage'
|
dependsOn 'stage'
|
||||||
|
|
||||||
|
// When tests are disabled this would still be run, so disable this manually
|
||||||
|
onlyIf { !project.rootProject.hasProperty("skipTests") }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("deletePIDFile") {
|
tasks.register("deletePIDFile") {
|
||||||
|
|
|
@ -50,6 +50,9 @@ tasks.register("startServer", com.github.psxpaul.task.ExecFork) {
|
||||||
waitForOutput = "datadog.smoketest.springboot.SpringbootApplication - Started SpringbootApplication"
|
waitForOutput = "datadog.smoketest.springboot.SpringbootApplication - Started SpringbootApplication"
|
||||||
timeout = 240
|
timeout = 240
|
||||||
stopAfter = test
|
stopAfter = test
|
||||||
|
|
||||||
|
// When tests are disabled this would still be run, so disable this manually
|
||||||
|
onlyIf { !project.rootProject.hasProperty("skipTests") }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Test).configureEach {
|
tasks.withType(Test).configureEach {
|
||||||
|
|
|
@ -50,6 +50,9 @@ tasks.register("unzip", Copy) {
|
||||||
} else {
|
} else {
|
||||||
throw new GradleException("Can't find server zip file that starts with: " + zipFileNamePrefix)
|
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) {
|
tasks.register("startServer", com.github.psxpaul.task.ExecFork) {
|
||||||
|
@ -83,6 +86,9 @@ tasks.register("startServer", com.github.psxpaul.task.ExecFork) {
|
||||||
]
|
]
|
||||||
|
|
||||||
dependsOn unzip
|
dependsOn unzip
|
||||||
|
|
||||||
|
// When tests are disabled this would still be run, so disable this manually
|
||||||
|
onlyIf { !project.rootProject.hasProperty("skipTests") }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("stopWildfly", Exec) {
|
tasks.register("stopWildfly", Exec) {
|
||||||
|
@ -92,6 +98,9 @@ tasks.register("stopWildfly", Exec) {
|
||||||
args = ["--connect", "--controller=localhost:${wildflyManagementPort}", "command=:shutdown"]
|
args = ["--connect", "--controller=localhost:${wildflyManagementPort}", "command=:shutdown"]
|
||||||
|
|
||||||
dependsOn startServer
|
dependsOn startServer
|
||||||
|
|
||||||
|
// When tests are disabled this would still be run, so disable this manually
|
||||||
|
onlyIf { !project.rootProject.hasProperty("skipTests") }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Test).configureEach {
|
tasks.withType(Test).configureEach {
|
||||||
|
|
|
@ -302,10 +302,8 @@ for (def env : System.getenv().entrySet()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable all tests if skipTests property was specified
|
// Disable all tests if skipTests property was specified
|
||||||
if (project.hasProperty("skipTests")) {
|
|
||||||
tasks.withType(Test).configureEach {
|
tasks.withType(Test).configureEach {
|
||||||
onlyIf { false }
|
onlyIf { !project.rootProject.hasProperty("skipTests") }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.withType(BasePlugin) {
|
plugins.withType(BasePlugin) {
|
||||||
|
|
Loading…
Reference in New Issue