From aa00747ed29c1529d2edddf6fef99e7ea9ca1796 Mon Sep 17 00:00:00 2001 From: Peter Darton Date: Fri, 24 Sep 2021 10:02:16 +0100 Subject: [PATCH] Stop hard-coding java path during ssh-connector tests (#858) - it used to be necessary, but no longer - ...and now java isn't where it used to be either. --- .../connector/DockerComputerSSHConnectorTest.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/test/java/io/jenkins/docker/connector/DockerComputerSSHConnectorTest.java b/src/test/java/io/jenkins/docker/connector/DockerComputerSSHConnectorTest.java index a7f8f16ef..f9f8d34c2 100644 --- a/src/test/java/io/jenkins/docker/connector/DockerComputerSSHConnectorTest.java +++ b/src/test/java/io/jenkins/docker/connector/DockerComputerSSHConnectorTest.java @@ -29,7 +29,20 @@ public class DockerComputerSSHConnectorTest extends DockerComputerConnectorTest { private static final String SSH_AGENT_IMAGE_IMAGENAME = "jenkins/ssh-agent"; - private static final String SSH_AGENT_IMAGE_JAVAPATH = "/usr/local/openjdk-8/bin/java"; + /** + * Where the JDK can be found. + *

+ * MAINTENANCE NOTE: Originally, Java was on the PATH and the SSH + * connector found it there. Then, the image changed and java wasn't on the path + * anymore and had to be set in the unit-tests to + * "/usr/local/openjdk-8/bin/java". Then, the image changed again + * and java was on the path again but had moved. + *

+ * TL;DR: If java is on the path then this can (and should) be null, but if it + * isn't on the path then we'll need to set this to where java has been moved + * to. + */ + private static final String SSH_AGENT_IMAGE_JAVAPATH = null; @Test public void connectAgentViaSSHUsingInjectSshKey() throws Exception {