Skip to content

Fix collect_metrics.py script for invalid linter results.

Ben Mort requested to merge refactor-junit-parser into master

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:

Screenshot_2020-07-02_at_15.51.58

JUnit XML file report (from clicking the linter badge in the above screenshot):

Screenshot_2020-07-02_at_15.53.37

Merge request reports