converting Puppet reports to JUnit

20 views
Skip to first unread message

Luke Bigum

unread,
May 10, 2019, 8:44:47 AM5/10/19
to Puppet Users
Hello,

Has anyone had the need to convert Puppet's YAML reports into another format, such as JUnit XML?  I'm thinking of taking the reports of Acceptance test runs of Roles (potentially thousands of resources), and parsing them into reports for a CI system.  The report format doesn't look too complicated, but before I reinvent someone else's wheel, I thought I'd check if there's any code I could steal off someone?

Cheers,

-Luke

Henrik Lindberg

unread,
May 10, 2019, 9:04:33 AM5/10/19
to puppet...@googlegroups.com
I remember using a JUnit compatible report format plugin for rspec.
Maybe that is what you are looking for?

This was quite some time ago and I don't remember its name.

- henrik

> Cheers,
>
> -Luke
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/a556b4c7-a19e-4a70-a185-02d4e79427a4%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/a556b4c7-a19e-4a70-a185-02d4e79427a4%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Luke Bigum

unread,
May 10, 2019, 12:38:08 PM5/10/19
to Puppet Users
On Friday, 10 May 2019 14:04:33 UTC+1, Henrik Lindberg wrote:
I remember using a JUnit compatible report format plugin for rspec.
Maybe that is what you are looking for?

This was quite some time ago and I don't remember its name.

Sort of. I also looking into rspec report formats as that would plug in better to rspec-puppet / beaker-puppet.  It's more to take the raw Puppet report YAML (https://puppet.com/docs/puppet/6.4/format_report.html) and converting it to a testing framework report format (an Junit is pretty common).  End result would look like any failures in the Puppet run could be presented in a CI system as "test" failures.

The YAML's pretty simple, it won't be too hard to write, just thought someone might have a great library that already does it...  :-)

Bart-Jan Vrielink

unread,
May 13, 2019, 3:05:12 AM5/13/19
to Puppet Users

Hello,


For rspec I have set the environment variable CI_SPEC_OPTIONS to '-r yarjuf -f JUnit -o result.xml -f progress'. This uses the gem yarjuf to generate a Junit results.xml file (which is saved as an artifact in Gitlab).


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/46c4dd81-5df0-4f38-95bb-20924222f916%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages