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

Error Message for Missing index.html confusing #21

Closed elm- closed 7 years ago

elm- commented 7 years ago

When the index.html file is missing but the directory exists, an exception is thrown due to a missing check on the list:

java.util.NoSuchElementException
    at java.util.LinkedList$ListItr.next(LinkedList.java:890)
    at org.jenkinsci.plugins.scoverage.ScoveragePublisher$ScovFinder.invoke(ScoveragePublisher.java:91)
    at org.jenkinsci.plugins.scoverage.ScoveragePublisher$ScovFinder.invoke(ScoveragePublisher.java:71)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2750)
    at hudson.remoting.UserRequest.perform(UserRequest.java:121)

This has been reported already and the workaround (run coverageReport) is explainted, but took me also some digging to get to the root cause. It should return also null so that the proper error message is shown from "Unable to find HTML reports under".

elm- commented 7 years ago

Added PR for fix.