junitify takes JSON tests from stdin and writes JUnit XML results into stdout, or into a directory specified with --out
.
This can be used to integrate with CI/CD platforms that uses JUnit XML format to show tests results in the UI, such as Gitlab.
shell
cargo install junitify
shell
cargo test -- --format=json -Z unstable-options --report-time | junitify --out tests/
0.1.13
)Since 0.1.13
you can transform Valgrind XML report into JUnit reports, for example:
fish.shell
fish
valgrind --tool=memcheck --xml=yes --xml-file=report.xml (cargo +nightly test -q --message-format=json --no-run | jq -r '.executable | select(. != null)')
junitify -k valgrind --out tests/ -f report.xml
shell
docker pull jonathanxd/junitify:latest
You can find an example of CI/CD usage in bindet .gitlab-ci.yml, and see how they look like in one of the pipeline reports.