Change some common settings for smoke-tests

log server output to files. Fix server dependencies. Only run smoke
tests on standard JVMs.
This commit is contained in:
Andrew Kent 2019-01-10 09:19:30 -08:00
parent 6089dc60ba
commit bfd653549f
3 changed files with 7 additions and 10 deletions

View File

@ -1,9 +1 @@
// Set properties before any plugins get loaded
project.ext {
// Execute tests on all JVMs, even rare and outdated ones
integrationTests = true
}
apply from: "${rootDir}/gradle/java.gradle"
description = 'dd-smoke-tests' description = 'dd-smoke-tests'

View File

@ -84,6 +84,7 @@ def randomOpenPort() {
} }
task startServer(type: com.github.psxpaul.task.ExecFork) { task startServer(type: com.github.psxpaul.task.ExecFork) {
dependsOn project(':dd-java-agent').shadowJar
playHttpPort = randomOpenPort() playHttpPort = randomOpenPort()
if (playHttpPort == -1) { if (playHttpPort == -1) {
@ -93,6 +94,7 @@ task startServer(type: com.github.psxpaul.task.ExecFork) {
workingDir = "${buildDir}/stage/playBinary" workingDir = "${buildDir}/stage/playBinary"
commandLine = "${workingDir}/bin/playBinary" commandLine = "${workingDir}/bin/playBinary"
stopAfter = test stopAfter = test
standardOutput "${buildDir}/reports/server.log"
// these params tells the ExecFork plugin to block on startServer task until the port is opened or the string is seen in the ouput // these params tells the ExecFork plugin to block on startServer task until the port is opened or the string is seen in the ouput
waitForPort = playHttpPort waitForPort = playHttpPort
waitForOutput = "Listening for HTTP on /127.0.0.1:${playHttpPort}" waitForOutput = "Listening for HTTP on /127.0.0.1:${playHttpPort}"
@ -120,7 +122,7 @@ tasks.withType(Test) {
events "started" events "started"
} }
dependsOn project(':dd-java-agent').shadowJar, startServer dependsOn startServer
} }
// clean up the PID file from the server // clean up the PID file from the server

View File

@ -67,6 +67,8 @@ task unzip(type: Copy) {
} }
task startServer(type: com.github.psxpaul.task.ExecFork) { task startServer(type: com.github.psxpaul.task.ExecFork) {
dependsOn project(':dd-java-agent').shadowJar
wildflyHttpPort = randomOpenPort() wildflyHttpPort = randomOpenPort()
// not used, but to ensure https default port 8443 won't clash // not used, but to ensure https default port 8443 won't clash
int httpsPort = randomOpenPort() int httpsPort = randomOpenPort()
@ -80,6 +82,7 @@ task startServer(type: com.github.psxpaul.task.ExecFork) {
commandLine = "${workingDir}/bin/standalone.sh" commandLine = "${workingDir}/bin/standalone.sh"
// ideally this should be good enough to use to stop wildfly, but wildfly needs to gracefully shutdown from jboss-cli.sh // ideally this should be good enough to use to stop wildfly, but wildfly needs to gracefully shutdown from jboss-cli.sh
// stopAfter = test // stopAfter = test
standardOutput "${buildDir}/reports/server.log"
// these params tells the ExecFork plugin to block on startServer task until the port is opened or the string is seen in the ouput // these params tells the ExecFork plugin to block on startServer task until the port is opened or the string is seen in the ouput
waitForPort = wildflyHttpPort waitForPort = wildflyHttpPort
waitForOutput = "Undertow HTTP listener default listening on 127.0.0.1:${wildflyHttpPort}" waitForOutput = "Undertow HTTP listener default listening on 127.0.0.1:${wildflyHttpPort}"
@ -112,7 +115,7 @@ tasks.withType(Test) {
events "started" events "started"
} }
dependsOn project(':dd-java-agent').shadowJar, startServer dependsOn startServer
} }
// ensure that the wildfly server gets shutdown // ensure that the wildfly server gets shutdown