Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Prevent unsafe cast to TestResult. #84
There are already null checks in TestResult.getPreviousResult() that calls AbstractRestResultAction.findCorrespondingResult() so presumably it's safe to return null here if the results aren't available.
The jenkins cucumber test result plugin (https://wiki.jenkins.io/display/JENKINS/Cucumber+Test+Result+Plugin) was getting a ClassCastException. This was being caused after having just installed the plugin and trying to call the json api as it was trying to get results from a previous build from before the plugin was installed:
Caused by: java.lang.ClassCastException: hudson.tasks.test.AggregatedTestResultAction$1 cannot be cast to hudson.tasks.test.TestResult