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
Install ansible-lint-to-junit-xml with pip:
pip install yaml-lint-to-junit-xml
Or 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:
yamllintmust run with-f parsablefor the output to be machine parsable
Features
- Pipe output directly from
yamllintcall - 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yaml-lint-to-junit-xml-0.1.1.tar.gz.
File metadata
- Download URL: yaml-lint-to-junit-xml-0.1.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cd1e26961c9816a7029d19ebe5509ce751f9a393a5e467d0ac8a5380b90309d
|
|
| MD5 |
9d8e53d2840f54fac91359d10042581d
|
|
| BLAKE2b-256 |
087367561d480d2e0ab39a36fb077a9287976252c5ea65488f107b4002117b26
|
File details
Details for the file yaml_lint_to_junit_xml-0.1.1-py2.py3-none-any.whl.
File metadata
- Download URL: yaml_lint_to_junit_xml-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8c7dac2e70a5f6b3d86ce9502fa3905eca6685b239bec003fdac05fdc800b99
|
|
| MD5 |
28b17a71232e2f942f548a37f52b5c80
|
|
| BLAKE2b-256 |
ce9a1e763e524b30a83bb691096823f179ba7244ebb3354c840c9ec266850777
|