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

Don't fail the build when scoverage data is missing

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • scoverage-plugin
    • None
    • Jenkins: 1.628
      scoverage-plugin: 1.2.1

      When the configured XML file does not exist, the build should not fail with an exception.

      It should be just set to "unstable".

      ERROR: Publisher 'Publish Scoverage Report' aborted due to exception: 
      java.io.IOException: /home/jenkins/home/jobs/eve-build/workspace/core/target/scala-2.11/scoverage-report not exists
      	at org.jenkinsci.plugins.scoverage.ScoveragePublisher.copyReport(ScoveragePublisher.java:124)
      	at org.jenkinsci.plugins.scoverage.ScoveragePublisher.perform(ScoveragePublisher.java:75)
      	at org.jenkinsci.plugins.scoverage.ScoveragePublisher.perform(ScoveragePublisher.java:61)
      	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
      	at hudson.model.Build$BuildExecution.post2(Build.java:185)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
      	at hudson.model.Run.execute(Run.java:1766)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:408)
      

          [JENKINS-30409] Don't fail the build when scoverage data is missing

          Peter lai added a comment - - edited

          I've previously mendtion this on https://github.com/shanbin/scoverage-plugin/issues/8 but just thought i'll post it here as well in case others are having the same problem.

          It seems the offending bug is here
          In ScoveragePublisher.java

          String relativeFix = content.replaceAll("href=\"/", "href=\"")
                                                  .replaceAll("href=\".*" + pattern + "/", "href=\"");
          

          I've replaced this string with

          String relativeFix = content.replaceAll("href=\"/", "href=\"")
                                                  .replaceAll(Matcher.quoteReplacement("href=\".*" + pattern + "/"), "href=\"");
          

          and it fixed the problem, after talking to Shanbin, he wants a more robust fix to the way html is handled. So for those who's having this problem, i recommend you download the code and change this line and produce you own scoverage plugin in the meant time.

          Peter lai added a comment - - edited I've previously mendtion this on https://github.com/shanbin/scoverage-plugin/issues/8 but just thought i'll post it here as well in case others are having the same problem. It seems the offending bug is here In ScoveragePublisher.java String relativeFix = content.replaceAll( "href=\" / ", " href=\"") .replaceAll( "href=\" .* " + pattern + " / ", " href=\""); I've replaced this string with String relativeFix = content.replaceAll( "href=\" / ", " href=\"") .replaceAll(Matcher.quoteReplacement( "href=\" .* " + pattern + " / "), " href=\""); and it fixed the problem, after talking to Shanbin, he wants a more robust fix to the way html is handled. So for those who's having this problem, i recommend you download the code and change this line and produce you own scoverage plugin in the meant time.

          Peter lai added a comment - - edited

          Crap, completely commented on the wrong ticket, My bad. Ignore everything above.

          P.s. I agree, it shouldn't fail the build if the scoverage plugin fails.

          Peter lai added a comment - - edited Crap, completely commented on the wrong ticket, My bad. Ignore everything above. P.s. I agree, it shouldn't fail the build if the scoverage plugin fails.

            Unassigned Unassigned
            jenkey Claudio B
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: