Created
April 10, 2019 13:49
-
-
Save black-silence/35b958fe92c704de551a3ca4ea082b87 to your computer and use it in GitHub Desktop.
quick-dirty phpunit xml result patcher so sonarphp doesn't choke
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import xml.etree.ElementTree as ET | |
et = ET.parse('logfile.xml') | |
root = et.getroot() | |
for mastersuites in root: | |
for suite in mastersuites: | |
if not "file" in suite.attrib: | |
continue | |
filename = suite.attrib['file'] | |
for subsuite in suite: | |
if subsuite.tag != "testsuite": | |
continue | |
if not "file" in subsuite.attrib: | |
subsuite.attrib['file'] = filename | |
et.write('logfile.xml') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@macghriogair does this result in importing coverage for tests using data providers, or are coverage metrics for those tests just discarded?