better_test_reporter
A CLI for generating a junit xml report from dart test json output and libraries for parsing test json into dev-friendly models
Tooling and libraries for processing dart test output into dev-friendly formats
^2.3.1^2.1.0^0.17.0^4.9.0^2.1.1^6.1.0^2.2.1^2.1.0^6.3.2^2.0.0^1.21.6English project snapshot. Visit GitHub for the latest content.
pub package Build status License: MIT Maintenance
This is an application/library heavily inspired by dart-junitreport and dart-testreport. It takes what was done in those two packages and brings them under a single umbrella, updates to null-safety, and makes various code style improvements.
The purpose of this package is three-fold:
report_to_junit) that
can be used to take in a full json report from the test json reporter and
generate a junit XML report(usable by many CI tools)This package is still experimental as we continue to build out more functionality. It's current state is barebones as we investigate ways to make the junit output more useful and ways to produce better testing reports for use outside of just junit.
In order to start using the report_to_junit command, install the latest
better_test_reporter as a global package via pub.dev.
pub global activate better_test_reporter
Details on all options for report_to_junit can be found by running report_to_junit --help
> report_to_junit --help
-i, --input the path to the 'json' file containing the output of 'pub run test'.
if missing, <stdin> will be used
-o, --output the path of the to be generated junit xml file.
if missing, <stdout> will be used
-b, --base the part to strip from the 'path' elements in the source
(defaults to the current working directory)
-p, --package the part to prepend to the 'path' elements in the source
(defaults to "")
-t, --timestamp the timestamp to be used in the report
- 'now' will use the current date/time
- 'none' will suppress timestamps altogether
- a date formatted 'yyyy-MM-ddThh:mm:ss' will be used as UTC date/time
- if no value is provided
- if '--input' is specified the file modification date/time is used
- otherwise the current date/time is used
-h, --help display this help text
dart-junitreport and dart-testreportdart-junitreport had a
special case for only one problem occurred. The multiple problem case also
handled the case for a single problem. We found the special case for a single
problem unneeded and a little buggy, so it was removed in
better_test_reporter.dart-testreport set tests as not hidden if they encountered any problems while
running. In better_test_reporter, the hidden attribute on a test will be
purely based on whether the test was explicitly hidden based on the
TestDoneEvent json. That said, we maintained the hidden behavior for the
output junit xml by shifting that decision out of the report and up to whatever
consumes the report.better_test_reporter defaults to
stripping the current working directory out of the classname.