[ https://issues.jenkins-ci.org/browse/JENKINS-13696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=162485#comment-162485 ]
Frank Cornelissen commented on JENKINS-13696: --------------------------------------------- Attaching the patch does not seem to work, so I copy /paste it here: {noformat} diff --git a/src/main/java/hudson/plugins/fitnesse/FitnesseExecutor.java b/src/main/java/hudson/plugins/fitnesse/FitnesseExecutor.java index 99f795c..af91fbf 100644 --- a/src/main/java/hudson/plugins/fitnesse/FitnesseExecutor.java +++ b/src/main/java/hudson/plugins/fitnesse/FitnesseExecutor.java @@ -3,9 +3,10 @@ package hudson.plugins.fitnesse; import hudson.EnvVars; import hudson.FilePath; import hudson.Launcher; -import hudson.Proc; import hudson.Launcher.ProcStarter; +import hudson.Proc; import hudson.model.AbstractBuild; +import hudson.model.Computer; import java.io.ByteArrayOutputStream; import java.io.File; @@ -214,9 +215,16 @@ public class FitnesseExecutor { return bucket.toByteArray(); } - public URL getFitnessePageCmdURL() throws MalformedURLException { + // FRANKC: fixme + public URL getFitnessePageCmdURL() throws IOException, InterruptedException { + String hostName = builder.getFitnesseHost(); + if (builder._LOCALHOST.equals(hostName)) { + // Frankc: get the slave name: + Computer current = Computer.currentComputer(); + hostName = current.getHostName(); + } return new URL("http", - builder.getFitnesseHost(), + hostName, builder.getFitnessePort(), getFitnessePageCmd()); } diff --git a/src/test/java/hudson/plugins/fitnesse/FitnesseExecutorTest.java b/src/test/java/hudson/plugins/fitnesse/FitnesseExecutorTest.java index 5308a7d..b15b403 100644 --- a/src/test/java/hudson/plugins/fitnesse/FitnesseExecutorTest.java +++ b/src/test/java/hudson/plugins/fitnesse/FitnesseExecutorTest.java @@ -163,7 +163,7 @@ public class FitnesseExecutorTest { } @Test - public void fitnessePageCmdURLShouldIncludeHostPortAndPageCmd() throws MalformedURLException { + public void fitnessePageCmdURLShouldIncludeHostPortAndPageCmd() throws Exception { executor = getExecutorForBuilder( new String[] {FitnesseBuilder.FITNESSE_HOST, FitnesseBuilder.FITNESSE_PORT, FitnesseBuilder.TARGET_PAGE, FitnesseBuilder.TARGET_IS_SUITE}, new String[] {"host", "1234", "WikiPage", "true"}); @@ -172,7 +172,7 @@ public class FitnesseExecutorTest { } @Test - public void fitnessePageCmdURLShouldIncludeLocalHostIfStartedByHudson() throws MalformedURLException { + public void fitnessePageCmdURLShouldIncludeLocalHostIfStartedByHudson() throws Exception { executor = getExecutorForBuilder( new String[] {FitnesseBuilder.START_FITNESSE, FitnesseBuilder.FITNESSE_HOST, FitnesseBuilder.FITNESSE_PORT, FitnesseBuilder.TARGET_PAGE, FitnesseBuilder.TARGET_IS_SUITE}, new String[] {"true", "unknown_host", "8989", "WikiPage", "true"}); {noformat} > Fitnesse should run on the slave of the build, not on the head node > ------------------------------------------------------------------- > > Key: JENKINS-13696 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13696 > Project: Jenkins > Issue Type: Improvement > Components: fitnesse > Environment: Distributed builds > Reporter: Frank Cornelissen > > The setup I use for jenkins is to have a single non building head node, and > several build slaves. In this case, the jenkins fitnesse plugin tries to run > fitnesse on the head node instead of the slave the build is running on.. > Attached is the fix I applied locally... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira