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

alwaysLinkToLastBuild not linking to last job result

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • htmlpublisher-plugin
    • None
    • Jenkins ver. 2.60.3
      HTML Publisher Plugin 1.14

      I`m using HTML Publisher Plugin on  kubernetes cluster slave in pipeline job

      stage('Publish HTML report') {
          publishHTML (target: [
                  allowMissing: false,
                  alwaysLinkToLastBuild: true,
                  keepAll: true,
                  reportDir: 'e2e-system-tests/target',
                  reportFiles: 'index.html',
                  reportName: "HTML Report"
                ])
      }

      When build fail i get folliwing result

       

      INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 01:05 min
      [INFO] Finished at: 2017-09-07T14:39:59+00:00
      [INFO] Final Memory: 38M/836M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (integration-test) on project e2e-system-tests: There are test failures.
      [ERROR] 
      [ERROR] Please refer to /home/jenkins/workspace/E2E-TEST-backend-userActivationErrorHandling/e2e-system-tests/target/surefire-reports for the individual test results.
      [ERROR] -> [Help 1]
      [ERROR] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (Publish HTML report)
      [Pipeline] publishHTML
      [htmlpublisher] Archiving HTML reports...
      [htmlpublisher] Archiving at BUILD level /home/jenkins/workspace/E2E-TEST-backend-userActivationErrorHandling/e2e-system-tests/target to /var/lib/jenkins/jobs/E2E-TEST-backend-userActivationErrorHandling/builds/10/htmlreports/HTML_Report
      [Pipeline] }
       
      

       

      When i go directly to job result
      http://jenkins:8080/job/E2E-TEST-backend-userActivationErrorHandling/10/console
      I see HTML Report but link also should be visible on the "main page" for job under url

      http://jenkins:8080/job/E2E-TEST-backend-userActivationErrorHandling/ but for some reason it`s not visible

      What can be a reason of this isssue ?

      Regards,

      Piotr

       

          [JENKINS-46722] alwaysLinkToLastBuild not linking to last job result

          Piotr Chmielnik created issue -
          Richard Bywater made changes -
          Assignee Original: mcrooney [ mcrooney ] New: Richard Bywater [ r2b2_nz ]
          Richard Bywater made changes -
          Comment [  Are you able to please share your publishHTML pipeline definition just so I know what your current config is? ]

          It appears that the Pipeline version of the code has a slight difference than that of the Freestyle job version. The pipeline version will currently only display the Project level menu option if there has been a last successful build. I'm guessing that out of your 10 runs so far there hasn't been a successful one?

          This doesn't seem quite right so I'll look into fixing it so the behaviour is maintained between both the Freestyle and Pipeline versions.

          Richard Bywater added a comment - It appears that the Pipeline version of the code has a slight difference than that of the Freestyle job version. The pipeline version will currently only display the Project level menu option if there has been a last successful build. I'm guessing that out of your 10 runs so far there hasn't been a successful one? This doesn't seem quite right so I'll look into fixing it so the behaviour is maintained between both the Freestyle and Pipeline versions.

          Yes, r2b2_nz you have right. I made more test and if there is a successful build there will be linked on project level menu. If it`s fail then still  there will be  linked last successful  build.

          Piotr Chmielnik added a comment - Yes, r2b2_nz you have right. I made more test and if there is a successful build there will be linked on project level menu. If it`s fail then still  there will be  linked last successful  build.

          Mat Mor added a comment -

          Same behavior here.

          The report is only attached to last successful build, failed build do not publish the report to the project level. All pipeline behave as such.

          Any workaround / news ?

          Mat Mor added a comment - Same behavior here. The report is only attached to last successful build, failed build do not publish the report to the project level. All pipeline behave as such. Any workaround / news ?

          Jason Davis added a comment -

          Also seeing this issue. Workarounds appreciated!

          Jason Davis added a comment - Also seeing this issue. Workarounds appreciated!

          George Petrov added a comment -

          My workaround is to send exit code 0 even when there are failures in the tests.

          George Petrov added a comment - My workaround is to send exit code 0 even when there are failures in the tests.

          Martin Røssland added a comment - - edited

          I have a build monitor where I would like to display the last cucumber test report. I also experience this issue where only successfully builds get published to the project level.

          Are there a chance this will be fixed in version 1.19?

          Using pipelines with jenkins 2.161 and HTML publisher plugin 1.18.

          Workaround in my case:

          Initially I tried to load the project report since it was a static url (example url):
          http://jenkins/job/tests/job/master/report/report.html

          Since the build failed it was only accessible on the specific build (example url):
          http://jenkins/job/tests/job/master/123/report/report.html

          I figured out that I could access the latest build through this static url (example url):
          http://jenkins/job/tests/job/master/lastCompletedBuild/report/report.html

          Conclusion:

          This issue is not a show stopper for me, but it would still be convenient to find the latest pipeline build, despite successfully run or not, in the project menu.

          Martin Røssland added a comment - - edited I have a build monitor where I would like to display the last cucumber test report. I also experience this issue where only successfully builds get published to the project level. Are there a chance this will be fixed in version 1.19? Using pipelines with jenkins 2.161 and HTML publisher plugin 1.18. Workaround in my case: Initially I tried to load the project report since it was a static url (example url): http://jenkins/job/tests/job/master/report/report.html Since the build failed it was only accessible on the specific build (example url): http://jenkins/job/tests/job/master/123/report/report.html I figured out that I could access the latest build through this static url (example url): http://jenkins/job/tests/job/master/lastCompletedBuild/report/report.html Conclusion: This issue is not a show stopper for me, but it would still be convenient to find the latest pipeline build, despite successfully run or not, in the project menu.
          Nicholas Brown made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]

            r2b2_nz Richard Bywater
            pchmielnik Piotr Chmielnik
            Votes:
            16 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated: