Skip to content

Commit

Permalink
Add an integer-based threshold for quality gates.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jan 4, 2024
1 parent 7c345c7 commit d1f0abe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public WarningsQualityGate(final int threshold, final QualityGateType type,
setCriticality(criticality);
}

public boolean isUnstable() {
return getCriticality() == QualityGateCriticality.UNSTABLE
|| getCriticality() == QualityGateCriticality.NOTE;
}

/**
* Sets the criticality of the quality gate.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void shouldHandleComplexConfiguration() {
assertThat(script).contains("filters: [excludeType('*toExclude*')]");
assertThat(script).contains("ignoreFailedBuilds: false");
assertThat(script).contains("ignoreQualityGate: true");
assertThat(script).contains("qualityGates: [[threshold: 1, type: 'NEW', criticality: 'FAILURE']]");
assertThat(script).contains("qualityGates: [[integerThreshold: 1, type: 'NEW', criticality: 'FAILURE']]");

assertThat(script).contains("pattern: 'firstText'");
assertThat(script).contains("sourceCodeEncoding: 'otherText'");
Expand Down

0 comments on commit d1f0abe

Please sign in to comment.