0

Using a declarative pipeline, I have a many stages, including 8 that involve testing in which standardized results are published via the junit publisher. Unfortunately, any test failures in any stage automatically mark all stages as unstable (ugh). In an attempt to post meaningful results to slack at the end of each stage, I'd like to include the name of the stage and the test metrics unique to that stage.

But it seems that the currentBuild object would only have the aggregate. Was hoping there was an API that could be used in the "post -> always" section of my stage in which I could gain access to the test counts that occurred (and were published) in that stage.

If so, I could send to slack under my own control.

borisivan
  • 71
  • 6
  • I would turn the tables here - how do you gather the test results to report? Aren't those separate reports? Not divided by stage? – hakamairi Feb 18 '19 at 07:38
  • @hakamairi -- the junit publisher per test stage processes those separate standardized xml test results and provides to jenkins. Slack (or whichever) can acquire the test metrics from jenkins, but only from the aggregate. Looking to be able to acquire the metrics from the stage. I know I could write separate code to parse those xml files and determine myself, but not looking to reinvent that wheel. – borisivan Feb 18 '19 at 15:21

0 Answers0