24 May 2019 22:23:35 UTC
- Distribution: Test2-Harness-Renderer-JUnit
- Module version: 0.001077
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (3)
- Testers (301 / 0 / 3)
- KwaliteeBus factor: 1
- 12.12% Coverage
- License: artistic_2
- Perl: v5.10.1
- Activity24 month
- Download (7.4KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Test2::Harness::Renderer::JUnit - Captures Test2::Harness results and emits a junit xml file.
On the command line, with yath:
JUNIT_TEST_FILE="/tmp/foo.xml" ALLOW_PASSING_TODOS=1 yath test -j18 t/*.t
Test2::Harness::Renderer::JUnitprovides JUnit output formatting sufficient to be parsed by Jenkins and hopefully other junit parsers.
This code borrows many ideas from
TAP::Formatter::JUnitbut unlike that module does not provide a method to emit a different xml file for every testcase. Instead, it defaults to emitting to a single junit.xml to whatever the directory was you were in when you ran yath. This can be overridden by setting the
Timing information is included in the JUnit XML since this is native to
In standard use, "passing TODOs" are treated as failure conditions (and are reported as such in the generated JUnit). If you wish to treat these as a "pass" and not a "fail" condition, setting
ALLOW_PASSING_TODOS=1in your environment will turn these into pass conditions.
The JUnit output generated was developed to be used by Jenkins (https://jenkins.io/). That's the build tool we use at the moment and needed to be able to generate JUnit output for.
This is the only method (other than finish) that is called by Test2::Harness in order to gather the data needed to emit the needed xml.
- close_open_failure_testcase($test, $new_test_number)
This method is called whenever a new test result or the end of a run is seen. Because we want to capture test diag messages after a failed test, we delay emitting a failure until we see the end of the testcase or until we see a new test number.
This method is called by Test2::Harness when all runs are complete. It takes what has been gathered to that point and creates the junit xml file.
XML::Generatorinstance, to be used to generate XML output.
This subroutine is called during object initialization for Test2::Hanress objects. We do basic setup here.
The source code repository for Test2-Harness-Renderer-JUnit can be found at https://github.com/CpanelInc/Test2-Harness-Renderer-JUnit.
Copyright 2019 Todd Rinaldo<lt>firstname.lastname@example.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Test2::Harness::Renderer::JUnit, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Test2::Harness::Renderer::JUnit
For more information on module installation, please visit the detailed CPAN module installation guide.