Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow thresholds to be empty #725

Merged
merged 1 commit into from
Mar 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,40 @@ package javaposse.jobdsl.dsl.helpers.publisher
import javaposse.jobdsl.dsl.Context

class ArchiveXUnitThresholdContext implements Context {
int unstable = 0
int unstableNew = 0
int failure = 0
int failureNew = 0
Integer unstable = 0
Integer unstableNew = 0
Integer failure = 0
Integer failureNew = 0

/**
* Sets the build to unstable if the number or percentage of test failures or skiped tests exceeds the threshold.
* Defaults to 0.
*/
void unstable(int unstable) {
void unstable(Integer unstable) {
this.unstable = unstable
}

/**
* Sets the build to unstable if the number or percentage of new test failures or skiped tests exceeds the
* threshold. Defaults to 0.
*/
void unstableNew(int unstableNew) {
void unstableNew(Integer unstableNew) {
this.unstableNew = unstableNew
}

/**
* Fails the build if the number or percentage of test failures or skiped tests exceeds the threshold.
* Defaults to 0.
*/
void failure(int failure) {
void failure(Integer failure) {
this.failure = failure
}

/**
* Fails the build if the number or percentage of test failures or skiped tests exceeds the threshold.
* Defaults to 0.
*/
void failureNew(int failureNew) {
void failureNew(Integer failureNew) {
this.failureNew = failureNew
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,24 @@ class PublisherContext extends AbstractExtensibleContext {
}
thresholds {
'org.jenkinsci.plugins.xunit.threshold.FailedThreshold' {
unstableThreshold xUnitContext.failedThresholdsContext.unstable
unstableNewThreshold xUnitContext.failedThresholdsContext.unstableNew
failureThreshold xUnitContext.failedThresholdsContext.failure
failureNewThreshold xUnitContext.failedThresholdsContext.failureNew
unstableThreshold xUnitContext.failedThresholdsContext.unstable == null ? ''
: xUnitContext.failedThresholdsContext.unstable
unstableNewThreshold xUnitContext.failedThresholdsContext.unstableNew == null ? ''
: xUnitContext.failedThresholdsContext.unstableNew
failureThreshold xUnitContext.failedThresholdsContext.failure == null ? ''
: xUnitContext.failedThresholdsContext.failure
failureNewThreshold xUnitContext.failedThresholdsContext.failureNew == null ? ''
: xUnitContext.failedThresholdsContext.failureNew
}
'org.jenkinsci.plugins.xunit.threshold.SkippedThreshold' {
unstableThreshold xUnitContext.skippedThresholdsContext.unstable
unstableNewThreshold xUnitContext.skippedThresholdsContext.unstableNew
failureThreshold xUnitContext.skippedThresholdsContext.failure
failureNewThreshold xUnitContext.skippedThresholdsContext.failureNew
unstableThreshold xUnitContext.skippedThresholdsContext.unstable == null ? ''
: xUnitContext.skippedThresholdsContext.unstable
unstableNewThreshold xUnitContext.skippedThresholdsContext.unstableNew == null ? ''
: xUnitContext.skippedThresholdsContext.unstableNew
failureThreshold xUnitContext.skippedThresholdsContext.failure == null ? ''
: xUnitContext.skippedThresholdsContext.failure
failureNewThreshold xUnitContext.skippedThresholdsContext.failureNew == null ? ''
: xUnitContext.skippedThresholdsContext.failureNew
}
}
thresholdMode xUnitContext.thresholdMode.xmlValue
Expand Down