Skip to content

Commit

Permalink
[GITLAB] don't fail, if no new coverage condition is provided
Browse files Browse the repository at this point in the history
Fixes #85
  • Loading branch information
tisoft authored and mc1arke committed Apr 19, 2020
1 parent c1decf6 commit 4092873
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ public void decorateQualityGateStatus(AnalysisDetails analysis, AlmSettingDto al
}
}

QualityGate.Condition newCoverageCondition = analysis.findQualityGateCondition(CoreMetrics.NEW_COVERAGE_KEY)
.orElseThrow(() -> new IllegalStateException("Could not find New Coverage Condition in analysis"));
String coverageValue = newCoverageCondition.getStatus().equals(QualityGate.EvaluationStatus.NO_VALUE) ? "0" : newCoverageCondition.getValue();

String coverageValue = analysis.findQualityGateCondition(CoreMetrics.NEW_COVERAGE_KEY)
.filter(condition -> condition.getStatus() != QualityGate.EvaluationStatus.NO_VALUE)
.map(QualityGate.Condition::getValue)
.orElse("0");

List<PostAnalysisIssueVisitor.ComponentIssue> openIssues = analysis.getPostAnalysisIssueVisitor().getIssues().stream().filter(i -> OPEN_ISSUE_STATUSES.contains(i.getIssue().getStatus())).collect(Collectors.toList());

Expand Down

0 comments on commit 4092873

Please sign in to comment.