Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-67171

When using "Start new FitNesse instance as part of build", Jenkins is not able to target the page specified with parameters in URL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • fitnesse-plugin
    • Jenkins 2.303.2
      fitnesse-plugin to latest version 1.34
      Running on Windows 10

      Hi,

      We have a FitNesse server that is installed and running next to our Jenkins instance, both managed by Windows services. So that FitNesse server is accessible all the time.

      In Jenkins we have a lot of jobs that call this FitNesse server on its dedicated port, and we can specify the target page (suite) with parameters like below:

      FrontPage.MainSuite.Suite1&var1=val1&var2=val2

      Which is then transformed into the following:

      http://host:port/FrontPage.MainSuite.Suite1?suite&var1=val1&var2=val2
      

      In this URL we can see that the "?suite" is automatically added in the URL before the parameters.

      Problem occurs when I want to set up a new job but this time I want to run a new instance of the FitNesse server on a different port (for testing purposes, to avoid ruining my automated tests).

      I select the option "Start new FitNesse instance as part of build", enter the needed details, type the same target page as above, but when the job starts execution, I get the following error:

      Starting new Fitnesse instance...
      [bin] $ java -jar C:\workdir\Jenkins\workspace\TestSynchroDev\FitNesseJar\v20191110\fitnesse-standalone.jar -d C:\workdir\Jenkins\workspace\TestSynchroDev -r FitNesseRoot -p 1234
      Wait for Fitnesse Server start
      nov. 18, 2021 11:32:38 AM fitnesse.ConfigurationParameter loadProperties
      INFO: No configuration file found (C:\workdir\Jenkins\workspace\TestSynchroDev\plugins.properties)
      Bootstrapping FitNesse, the fully integrated standalone wiki and acceptance testing framework.
      root page: fitnesse.wiki.fs.FileSystemPage at C:\workdir\Jenkins\workspace\TestSynchroDev\FitNesseRoot#latest
      logger: none
      authenticator: fitnesse.authentication.PromiscuousAuthenticator
      page factory: fitnesse.html.template.PageFactory
      page theme: bootstrap
      Starting FitNesse on port: 1234
      java.lang.RuntimeException: Response for page http://localhost:1234/FrontPage.MainSuite.Suite1&var1=val1&var2=val2 is 404
      	at hudson.plugins.fitnesse.FitnesseExecutor.isFitnesseStarted(FitnesseExecutor.java:231)
      	at hudson.plugins.fitnesse.FitnesseExecutor.execute(FitnesseExecutor.java:62)
      	at hudson.plugins.fitnesse.FitnesseBuilder.perform(FitnesseBuilder.java:305)
      	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
      	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:806)
      	at hudson.model.Build$BuildExecution.build(Build.java:198)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:514)
      	at hudson.model.Run.execute(Run.java:1888)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:99)
      	at hudson.model.Executor.run(Executor.java:431)
      

      And if I try to access the specified URL "http://localhost:1234/FrontPage.MainSuite.Suite1&var1=val1&var2=val2", directly on the machine, it does not work and displays the following:

      Not Found:FrontPage.MainSuite.Suite1&var1=val1&var2=val2
      The requested resource: FrontPage.MainSuite.Suite1&var1=val1&var2=val2 was not found.
      

      We can see that Jenkins is not able to add the "?suite" option to check for page availibility.

       

      Now, I'm not an expert in Java, but I tried having a look at the source code of fitnesse-plugin.

      In FitnesseExecutor.java, line 62, I can see :

      if (!fitnesseProc.isAlive() || !isFitnesseStarted(getFitnessePage(build, false))) {
      

      which calls getFitnessePage with "false" as value for second parameter.

      Then on line 362 in the getFitnessePage method, the returned value is made of line 367:

      withCommand ? getFitnessePageCmd() : getFitnessePageBase()
      

      so in this case we will be using "getFitnessePageBase" right?

      Which method is checking for parameters presence after "?" symbol and takes only what is before (in my example it would be "http://localhost:1234/FrontPage.MainSuite.Suite1").

      I would expect another condition in this method checking for "&" symbol presence.

       

      I already tried changing the value of Target Page from "FrontPage.MainSuite.Suite1&var1=val1&var2=val2" to "FrontPage.MainSuite.Suite1?var1=val1&var2=val2" but it is also failing.

       

      Let me know if I'm not clear enough and you need more details but I think I've covered the issue I'm facing.

      Thanks and regards,

      Brice

            jruzafa JUAN ANTONIO RUZAFA SALA
            briceparmentier26 Brice Parmentier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: