Under ideal conditions, I would assume a test failure means the report
would either be incomplete or not useful isn't it?

AFAIK there isn't a post-build job for a stage, you can do it at a job
level though using "Run If" Attribute of the tasks. Here are a few ways to
get what you need, it might range from ugly to "Oh, that's interesting". If
you do decide to choose these methods please drop a line so I know if it
was useful :-)

*Option 1*:
Assuming you can tell from the reports if a test has failed or not, you
just have a dummy task after the tests that runs on runif="any" and do the
aggregation on the next stage. If you know from the reports something has
failed you can always fail the aggregate stage with some useful
information.
*Cons*: The failure will not immediately tell you what failed but again if
the folks who need to view the error have access to GoCD logs they can
always view the error and take necessary actions.

*Option 2:*
Very similar to Option 1, but if you can't tell from the reports if a test
has failed then you can emit an artifact that says if a test has failed or
not and then do the same in the aggregate stage to parse these artifacts
and then decide to fail the stage.
*Cons*: If the previous option wasn't ugly enough, this definitely feels
that way for me.

*Option 3:*
Have a separate stage after the tests that does the aggregation, instead of
doing all the gymnastics with artifacts or run if attributes, you can write
a notification plugin that listens to *only failure* events of this stage
and then manually trigger the next stage.
*Cons*: Effort to writing to a plugin and maintaining it. Let me know if
you are comfortable contributing this to the gocd-slack-notifier
<https://github.com/ashwanthkumar/gocd-slack-build-notifier> plugin. Happy
to collaborate on this if required too.

Thanks,


On Fri, 6 Jan 2023 at 18:54, 'Alexey Savchkov' via go-cd <
go-cd@googlegroups.com> wrote:

> I'm stuck with a problem which I can't think of a good solution for so
> would like to know your thoughts on the subject.
> One stage of my pipeline is a test matrix consisting of 6 jobs. Each job
> produces an Allure test report. Now I need to collect these individual test
> reports and build an aggregate one from them. Normally I would do it in
> some kind of a post-build job running at the end of each stage or the
> entire pipeline. But as far as I see there are no such post-build jobs in
> GoCD. I also can't use a separate stage for this since it won't start if
> the test stage fails due to failed tests. The only possibility I see is to
> start a dedicated job (say, "Report") in the test stage together with the
> test jobs, make it continuously poll the states of the test jobs and when
> all of them are completed fetch their report artifacts and build the total
> report. Wasting of runners when they are just waiting for the test jobs to
> finish but still acceptable.
> Am I not missing anything very basic as to how to go about such cases in
> GoCD? What would you propose? An external storage (Nexus) is available if
> this matters.
>
> Thank you very much in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to go-cd+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/go-cd/d70ab788-59d1-45d3-a088-77b97b3fe309n%40googlegroups.com
> <https://groups.google.com/d/msgid/go-cd/d70ab788-59d1-45d3-a088-77b97b3fe309n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

Ashwanth Kumar / ashwanthkumar.in

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to go-cd+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/CAD9m7CxNguDpOnjw6ADXYWkVmJFgf9dr6T66qdZsOFFHpA1jfw%40mail.gmail.com.

Reply via email to