Skip to content

Commit

Permalink
Change some common settings for smoke-tests
Browse files Browse the repository at this point in the history
log server output to files. Fix server dependencies. Only run smoke
tests on standard JVMs.
  • Loading branch information
Andrew Kent committed Jan 10, 2019
1 parent 6089dc6 commit bfd6535
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
8 changes: 0 additions & 8 deletions dd-smoke-tests/dd-smoke-tests.gradle
Original file line number Diff line number Diff line change
@@ -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'
4 changes: 3 additions & 1 deletion dd-smoke-tests/play/play.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def randomOpenPort() {
}

task startServer(type: com.github.psxpaul.task.ExecFork) {
dependsOn project(':dd-java-agent').shadowJar
playHttpPort = randomOpenPort()

if (playHttpPort == -1) {
Expand All @@ -93,6 +94,7 @@ task startServer(type: com.github.psxpaul.task.ExecFork) {
workingDir = "${buildDir}/stage/playBinary"
commandLine = "${workingDir}/bin/playBinary"
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
waitForPort = playHttpPort
waitForOutput = "Listening for HTTP on /127.0.0.1:${playHttpPort}"
Expand Down Expand Up @@ -120,7 +122,7 @@ tasks.withType(Test) {
events "started"
}

dependsOn project(':dd-java-agent').shadowJar, startServer
dependsOn startServer
}

// clean up the PID file from the server
Expand Down
5 changes: 4 additions & 1 deletion dd-smoke-tests/wildfly/wildfly.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ task unzip(type: Copy) {
}

task startServer(type: com.github.psxpaul.task.ExecFork) {
dependsOn project(':dd-java-agent').shadowJar

wildflyHttpPort = randomOpenPort()
// not used, but to ensure https default port 8443 won't clash
int httpsPort = randomOpenPort()
Expand All @@ -80,6 +82,7 @@ task startServer(type: com.github.psxpaul.task.ExecFork) {
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
// 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
waitForPort = wildflyHttpPort
waitForOutput = "Undertow HTTP listener default listening on 127.0.0.1:${wildflyHttpPort}"
Expand Down Expand Up @@ -112,7 +115,7 @@ tasks.withType(Test) {
events "started"
}

dependsOn project(':dd-java-agent').shadowJar, startServer
dependsOn startServer
}

// ensure that the wildfly server gets shutdown
Expand Down

0 comments on commit bfd6535

Please sign in to comment.