This guy seems to have the same problem。junkinsパイプラインをxunitで停止させるにはどうすればいいですか?
stage('Test') {
steps {
bat "\"${tool 'VSTestRunner'}\" %WORKSPACE%\\MyApp\\bin\\Debug\\MyApp.dll /logger:trx & exit 0"
// The test publish is responsible for decided whether the test stage failed
step([$class : 'XUnitPublisher',
testTimeMargin: '3000',
thresholdMode: 1,
thresholds: [
[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '1', unstableNewThreshold: '', unstableThreshold: ''],
[$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']
],
tools : [[$class: 'MSTestJunitHudsonTestType',
deleteOutputFiles: true,
failIfNotNew: false,
pattern: "TestResults\\*.trx",
skipNoTestFiles: false,
stopProcessingIfError: true
]]
])
}
}
をテストが継続パイプラインを失敗した場合:ここで
は私がやっているものです。
xunit設定でパイプラインを継続するかどうかを制御できるようにしたいと考えています。これよりももっとエレガントな方法がありますか?
if (currentBuild.result.equals("FAILURE")) {
throw "Test results did not pass thresholds"
}
「stopProcessingIfError」とは何ですか?私はエラーしきい値を超えてもパイプラインを止めると思ったが、そうではなかった。それを行うxunitサービスのparamはありますか?
一般に、ビルドに失敗したい場合は、終了ステータスをスローする必要があります!= 0 – OK999
どのようなエラーレベルが可能ですか私?失敗、成功、不安定? – red888