Skip to content

Instantly share code, notes, and snippets.

@timja
Created August 16, 2020 14:03
Show Gist options
  • Save timja/e4b001a528302978f5a0224f894fb182 to your computer and use it in GitHub Desktop.
Save timja/e4b001a528302978f5a0224f894fb182 to your computer and use it in GitHub Desktop.
junit-pluggable-pipeline.groovy
node('master') {
writeFile file: 'x.xml', text: '''<testsuite name='sweet'><testcase classname='Klazz' name='test1'><error message='failure'/></testcase><testcase classname='Klazz' name='test2'/><testcase classname='other.Klazz' name='test3'><skipped message='Not actually run.'/></testcase></testsuite>'''
def s = junit 'x.xml'
echo(/summary: fail=$s.failCount skip=$s.skipCount pass=$s.passCount total=$s.totalCount/)
writeFile file: 'x.xml', text: '''<testsuite name='supersweet'><testcase classname='another.Klazz' name='test1'><error message='another failure'/></testcase></testsuite>'''
s = junit 'x.xml'
echo(/next summary: fail=$s.failCount skip=$s.skipCount pass=$s.passCount total=$s.totalCount/)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment