shanbin / scoverage-plugin

Jenkins scoverage plugin for Scala code coverage
https://wiki.jenkins-ci.org/display/JENKINS/Scoverage+Plugin
MIT License
6 stars 19 forks source link

Clicking on coverage graph from job summary page results in 404 #4

Closed thricejamie closed 9 years ago

thricejamie commented 9 years ago

On the Jenkins job summary page, I'm seeing the graph of coverage results over time, but if I click on the graph I'm reaching an error page:

HTTP ERROR 404

Problem accessing /job/(job name)/scoverage/. Reason:

    Not Found

Jenkins ver. 1.575 Scoverage plugin v 1.1.0

shanbin commented 9 years ago

Would you please let me know the build tool / version you use?

It will be greatly helpful if you can share the layout of workspace, like the followings.

repo |_src _target/site/scoverage

thricejamie commented 9 years ago

I'm using sbt 0.13.6, sbt-scoverage 1.0.1.

As far as workspace layout, the sbt project root directory is a subdirectory of the repository root. After I run scoverage with sbt, I'm copying the scoverage-report to a different location outside of the sbt target directory so I can generate a non-scoverage-instrumented assembly jar.

So it ends up looking like the following

repository-root-dir
   |_ sbt-project-dir
      |_src
      |_project
      |_target
         ...
      |_scoverage-report

So the scoverage plugin config points to report directory sbt-project-dir/scoverage-report, file scoverage.xml.

shanbin commented 9 years ago

Thanks, I guess the reason is scoverage-report is moved outside target directory.

Please try to move it to a 2nd level directory under repo-root-dir, maybe abc/scoverage-report.

I'll also try it out locally and give a fix if applicable.

thisismana commented 9 years ago

I'm having the same issue. Running on Cloudbees, the jobs get executed on a different node. I'm using the workflow plugin:

    step([
      $class   : 'ScoveragePublisher',
      reportDir: "target/scala-2.10/scoverage-report",
      reportFile: "scoverage.xml"
    ])

As mentioned above, the link to scoverage report leads to a 404.

As a workaround we manually archive the coverage report to make it accessible through the archives view ${JENKINS_SERVER}/${JOB_NAME}/${BUILD_ID}/artifact/

archive 'target/scala-2.10/scoverage-report/**'
shanbin commented 9 years ago

Should be fixed in the latest 1.2.1.