Fix collect_metrics.py script for invalid linter results.
Summary
This fixes an issue found where the linter result badge for the sdp-prototype repo was not being generated correctly.
The previous version of collect_metrics.py
was not properly handling a top level tag in the JUnit file and therefore reporting 0 linter fails when the actual number should have been 52.
Tests have been added (along with a tox.ini
, setup.py
and Pipenv
for running them) using sample XML files taken from the sdp-prototype
use case.
Note: This will need careful review as the updated script has not been tested with reports from a live repo via the ci-badges-func.sh
Screenshots
Zero linter errors incorrectly reported in badge:
JUnit XML file report (from clicking the linter badge in the above screenshot):