Convert yaml-lint outputs to a jUnit valid xml tests result file
Project description
Yaml Lint to jUnit XML
Convert yaml-lint outputs to a jUnit valid xml tests result file.
Thanks to the author of the original project ansible-lint-to-junit-xml
Quickstart
Installation by pip is not working yet (TODO)
You can simply get this repo and install with setup.py
Usage
Run yamllint
on the desired files and pipe to yaml-lint-to-junit-xml
yamllint -f parsable <file or directly> | yaml-lint-to-junit-xml > results/yaml-lint-results.xml
Alternatively you can run yamllint
separately from yaml-lint-to-junit-xml
and use a file to pass the output
yamllint -f parsable <file or directly> > yaml-lint-results.txt
yaml-lint-to-junit-xml yaml-lint-results.txt > results/yaml-lint-results.xml
Note:
yamllint
must run with-f parsable
for the output to be machine parsable
Features
- Pipe output directly from
yamllint
call - Output XML file is compliant with jenkins junit5 Schema.
Example
Running yamllint
on a file results in:
roles/test_role/defaults/main.yml:25:121: [warning] line too long (157 > 120 characters) (line-length)
roles/test_role/tasks/main.yml:33:35: [error] no new line character at the end of file (new-line-at-end-of-file)
test_playbook.yml:4:8: [warning] truthy value should be one of [False, True, false, true] (truthy)
Running yamllint
and piping the output to yaml-lint-to-junit-xml
looks line this:
yamllint -f parsable test_playbook.yml | yaml-lint-to-junit-xml
Would result in:
<?xml version="1.0" ?>
<testsuite errors="1" name="yaml-lint" tests="1">
<testcase name="truthy value should be one of [False, True, false, true] (truthy)">
<failure message="test_playbook.yml:4:8: [warning] truthy value should be one of [False, True, false, true] (truthy)" type="yaml-lint">
yaml-lint exception type: warning
yaml-lint exception description: truthy value should be one of [False, True, false, true] (truthy)
filename: test_playbook.yml
line nr: 4:8
</failure>
</testcase>
</testsuite>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for yaml-lint-to-junit-xml-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3a0da4895e949d9edcab1f3fb537f463bf48e92c4c3308605d4bd56c315eee2 |
|
MD5 | f79162ef6030a7ccf7ce688945eef301 |
|
BLAKE2b-256 | e8d0af94e2b8d52f531ab2a780119792f677ec48c4260a994d1efa1e895f2070 |
Hashes for yaml_lint_to_junit_xml-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1220cd98f40863c58c16d8a89a6829344482f4bce7c6faab6482b601fad1f8e2 |
|
MD5 | d2506201c06f480787302998699d61cf |
|
BLAKE2b-256 | 41cb2690512a5c3ecb637430383da807a588991a783f18145a3fbf0b05d180e2 |