diff options
| author | Matt Rendina <mrendina@stsci.edu> | 2017-11-29 14:54:22 -0500 |
|---|---|---|
| committer | Matt Rendina <mrendina@stsci.edu> | 2017-11-29 14:54:22 -0500 |
| commit | 1d9b1b2c5b26ab81e705cb03d924518257f65f47 (patch) | |
| tree | d0f3687b9906fa14b5250bf7bdac5851cd6b0950 | |
| parent | 9c3041d99faf634f28a8de62d684d2180ac22663 (diff) | |
| download | jscu_refactor-1d9b1b2c5b26ab81e705cb03d924518257f65f47.tar.gz | |
Try using threshold class
| -rw-r--r-- | src/BuildConfig.groovy | 26 | ||||
| -rw-r--r-- | vars/utils.groovy | 2 |
2 files changed, 17 insertions, 11 deletions
diff --git a/src/BuildConfig.groovy b/src/BuildConfig.groovy index afe3f76..4bf1269 100644 --- a/src/BuildConfig.groovy +++ b/src/BuildConfig.groovy @@ -1,5 +1,6 @@ // src/BuildConfig.groovy -package BuildConfig; +package BuildConfig; +import org.jenkinsci.plugins.xunit.threshold.XUnitThreshold //@AutoClone // annotation is not CPS-compatible? class BuildConfig implements Serializable { @@ -9,28 +10,33 @@ class BuildConfig implements Serializable { def build_cmds = [] def test_cmds = [] def run_tests = true - def xunit_map = [[$class: 'SkippedThreshold', failureThreshold: '0'], - [$class: 'FailedThreshold', unstableThreshold: '1'], - [$class: 'FailedThreshold', failureThreshold: '6']] + def thresh = XUnitThreshold() + def thresholds = [[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: ''], + [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']], // Constructors - BuildConfig() { - nodetype = "" - } + //BuildConfig() { + // nodetype = "" + //} BuildConfig(nodetype) { this.nodetype = nodetype } + //def setTestThreshold(valuemap) { + // for (threshold in this.xunit_map) { + // if (threshold + //} + // copy method requires Jenkins script approval for the // following signatures: // method groovy.lang.MetaBeanProperty getSetter // method groovy.lang.MetaObjectProtocol getProperties // method groovy.lang.MetaProperty getProperty java.lang.Object // method groovy.lang.MetaProperty setProperty java.lang.Object java.lang.Object - def BuildConfig copy(){ - BuildConfig.metaClass.getProperties().findAll(){it.getSetter()!=null}.inject(new BuildConfig()){buildconfig,metaProp-> - metaProp.setProperty(buildconfig,metaProp.getProperty(this)) + def BuildConfig copy() { + BuildConfig.metaClass.getProperties().findAll(){it.getSetter()!=null}.inject(new BuildConfig()){ + buildconfig,metaProp->metaProp.setProperty(buildconfig,metaProp.getProperty(this)) buildconfig } } diff --git a/vars/utils.groovy b/vars/utils.groovy index 75267b7..eff3de2 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -82,7 +82,7 @@ def concurrent(configs) { // [$class: 'FailedThreshold', failureThreshold: '6']], // tools: [[$class: 'JUnitType', pattern: '*.xml']]]) step([$class: 'XUnitBuilder', - thresholds: [myconfig.xunit_map], + thresholds: [myconfig.thresholds], tools: [[$class: 'JUnitType', pattern: '*.xml']]]) } } |
