Skip to content
Permalink
Browse files

Merge pull request #55 from mbarrien/pipeline

JENKINS-30700 / #50 Jenkins pipeline support
  • Loading branch information...
mbarrien committed Apr 25, 2017
2 parents 75d7da7 + 4cdc216 commit 681d24c4def7b8b74f0186bc15f205c634524f62
@@ -385,6 +385,13 @@ public void perform(Run<?, ?> build, FilePath workspace, Launcher launcher, fina
FilePath[] reports = null;
try {
reports = workspace.act(new ParseReportCallable(coberturaReportFile));

// if the build has failed, then there's not
// much point in reporting an error
if (buildResult != null && buildResult.isWorseOrEqualTo(Result.FAILURE) && reports.length == 0) {
return;
}

} catch (IOException e) {
Util.displayIOException(e, listener);
e.printStackTrace(listener.fatalError("Unable to find coverage results"));
@@ -694,9 +701,10 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws FormExc
*/
@Override
public CoberturaPublisher newInstance(StaplerRequest req, JSONObject formData) throws FormException {
if (req == null) {
return null;
}
// Null check because findbugs insists, despite the API guaranteeing this is never null.
if (req == null) {
throw new FormException("req cannot be null", "");
}
CoberturaPublisher instance = req.bindJSON(CoberturaPublisher.class, formData);
ConvertUtils.register(CoberturaPublisherTarget.CONVERTER, CoverageMetric.class);
List<CoberturaPublisherTarget> targets = req
@@ -106,13 +106,12 @@ public float getSetPercent(CoverageResult coverage, CoverageMetric key) {
}

public Map<CoverageMetric, Integer> getRangeScores(CoverageTarget min, Map<CoverageMetric, Ratio> results) {
Integer j;
Map<CoverageMetric, Integer> result = new EnumMap<CoverageMetric, Integer>(CoverageMetric.class);
for (Map.Entry<CoverageMetric, Integer> target : this.targets.entrySet()) {
Ratio observed = results.get(target.getKey());
if (observed != null) {
j = CoverageTarget.calcRangeScore(target.getValue() / 100000, min.targets.get(target.getKey()), observed.getPercentage());
result.put(target.getKey(), j);
int j = CoverageTarget.calcRangeScore(target.getValue() / 100000, min.targets.get(target.getKey()), observed.getPercentage());
result.put(target.getKey(), Integer.valueOf(j));
}
}
return result;

0 comments on commit 681d24c

Please sign in to comment.
You can’t perform that action at this time.