fix(test_stats.py)_: report path

This commit is contained in:
Igor Sirotin 2024-08-23 10:40:09 +01:00
parent 9112e5cd3e
commit 6bd543a8e4
No known key found for this signature in database
GPG Key ID: 425E227CAAB81F95
1 changed files with 9 additions and 10 deletions

View File

@ -6,18 +6,17 @@ from collections import defaultdict
test_stats = defaultdict(lambda: defaultdict(int))
for file in glob.glob("**/report_*.xml", recursive=True):
tree = ET.parse(file)
root = tree.getroot()
for testcase in root.iter("testcase"):
test_name = testcase.attrib["name"]
tree = ET.parse("report.xml")
root = tree.getroot()
for testcase in root.iter("testcase"):
test_name = testcase.attrib["name"]
test_stats[test_name]["total_runs"] += 1
test_stats[test_name]["total_runs"] += 1
if testcase.find("failure") is not None:
test_stats[test_name]["failed_runs"] += 1
elif testcase.find("error") is not None:
test_stats[test_name]["failed_runs"] += 1
if testcase.find("failure") is not None:
test_stats[test_name]["failed_runs"] += 1
elif testcase.find("error") is not None:
test_stats[test_name]["failed_runs"] += 1
failing_test_stats = [
{