Be more specific about java binary and home location in integration tests
Otherwise things work in weird way on Linux
MODIFY
dd-smoke-tests/springboot/src/test/groovy/datadog/smoketest/SpringBootSmokeTest.groovy
dd-smoke-tests/springboot/src/test/groovy/datadog/smoketest/SpringBootSmokeTest.groovy
@@ -9,7 +9,7 @@ class SpringBootSmokeTest extends AbstractServerSmokeTest {
String springBootShadowJar = System.getProperty("datadog.smoketest.springboot.shadowJar.path")
List<String> command = new ArrayList<>()
- command.add("java")
+ command.add(javaPath())
command.addAll(defaultJavaProperties)
command.addAll((String[]) ["-jar", springBootShadowJar, "--server.port=${httpPort}"])
ProcessBuilder processBuilder = new ProcessBuilder(command)

MODIFY
dd-smoke-tests/src/main/groovy/datadog/smoketest/AbstractSmokeTest.groovy
dd-smoke-tests/src/main/groovy/datadog/smoketest/AbstractSmokeTest.groovy
@@ -33,6 +33,8 @@ abstract class AbstractSmokeTest extends Specification {
ProcessBuilder processBuilder = createProcessBuilder()
+ processBuilder.environment().put("JAVA_HOME", System.getProperty("java.home"))
+
processBuilder.redirectErrorStream(true)
File log = new File("${buildDirectory}/reports/serverProcess.log")
processBuilder.redirectOutput(ProcessBuilder.Redirect.to(log))
@@ -40,6 +42,11 @@ abstract class AbstractSmokeTest extends Specification {
serverProcess = processBuilder.start()
}
+ String javaPath() {
+ final String separator = System.getProperty("file.separator");
+ return System.getProperty("java.home") + separator + "bin" + separator + "java";
+ }
+
def cleanupSpec() {
serverProcess?.waitForOrKill(1)
}

Be more specific about java binary and home location in integration tests

Otherwise things work in weird way on Linux