diff options
| author | TG0000 <122870448+TG0000@users.noreply.github.com> | 2026-11-23 01:54:06 +0100 |
|---|---|---|
| committer | TG0000 <122870448+TG0000@users.noreply.github.com> | 2026-11-23 01:54:06 +0100 |
| commit | cfb4a6fbf45e5be964c3bf789fcd2951d481b00e (patch) | |
| tree | d656b6f9bad1a5e8a214a178a5144dee4ed53f5a /tools/progress_dashboard.py | |
| parent | 03b09a086592a197db64d91655c6e65c30764d96 (diff) | |
Check imported CTest reports for stale results
Diffstat (limited to 'tools/progress_dashboard.py')
| -rw-r--r-- | tools/progress_dashboard.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/progress_dashboard.py b/tools/progress_dashboard.py index ddfddbf3a..be8a4dd4b 100644 --- a/tools/progress_dashboard.py +++ b/tools/progress_dashboard.py | |||
| @@ -338,9 +338,9 @@ def group_of_test(name): | |||
| 338 | 338 | ||
| 339 | 339 | ||
| 340 | # ----------------------------------------------------------------------------------------------- ctest / junit | 340 | # ----------------------------------------------------------------------------------------------- ctest / junit |
| 341 | def parse_junit(text): | 341 | def parse_junit(xml): |
| 342 | """[(name, result, seconds, detail)] from CTest (--output-junit) or pytest (--junitxml) XML.""" | 342 | """[(name, result, seconds, detail)] from CTest (--output-junit) or pytest (--junitxml) XML.""" |
| 343 | root = ET.fromstring(text) | 343 | root = xml if isinstance(xml, ET.Element) else ET.fromstring(xml) |
| 344 | suites = [root] if root.tag == "testsuite" else root.findall("testsuite") | 344 | suites = [root] if root.tag == "testsuite" else root.findall("testsuite") |
| 345 | out = [] | 345 | out = [] |
| 346 | for suite in suites: | 346 | for suite in suites: |
| @@ -392,7 +392,7 @@ def collect_ctest(col, args): | |||
| 392 | log = os.path.join(ROOT, "runtime", "build", "Testing", "Temporary", "LastTest.log") | 392 | log = os.path.join(ROOT, "runtime", "build", "Testing", "Temporary", "LastTest.log") |
| 393 | sets = [] | 393 | sets = [] |
| 394 | if os.path.isfile(log): | 394 | if os.path.isfile(log): |
| 395 | sets.append(("ctest", log, [(n, r, s, "") for n, r, s in parse_lasttest(read_utf8(log))])) | 395 | sets.append(("ctest", log, [(n, r, s, "") for n, r, s in parse_lasttest(read_utf8(log))], True)) |
| 396 | col.source("ctest_lasttest", log, "ok", len(sets[-1][2])) | 396 | col.source("ctest_lasttest", log, "ok", len(sets[-1][2])) |
| 397 | else: | 397 | else: |
| 398 | col.source("ctest_lasttest", log, "missing", note="no runtime/build CTest run on this machine") | 398 | col.source("ctest_lasttest", log, "missing", note="no runtime/build CTest run on this machine") |
| @@ -401,20 +401,23 @@ def collect_ctest(col, args): | |||
| 401 | col.source("junit", path, "missing") | 401 | col.source("junit", path, "missing") |
| 402 | continue | 402 | continue |
| 403 | try: | 403 | try: |
| 404 | rows = parse_junit(read_utf8(path)) | 404 | root = ET.fromstring(read_utf8(path)) |
| 405 | except ET.ParseError as e: | 405 | except ET.ParseError as e: |
| 406 | col.source("junit", path, "invalid", note=str(e)) | 406 | col.source("junit", path, "invalid", note=str(e)) |
| 407 | continue | 407 | continue |
| 408 | sets.append(("junit:" + os.path.basename(path), path, rows)) | 408 | # CTest writes a single testsuite with a disabled count and hostname. pytest wraps its suite in testsuites. |
| 409 | is_ctest = root.tag == "testsuite" and {"disabled", "hostname"} <= root.attrib.keys() | ||
| 410 | rows = parse_junit(root) | ||
| 411 | sets.append(("junit:" + os.path.basename(path), path, rows, is_ctest)) | ||
| 409 | col.source("junit", path, "ok", len(rows)) | 412 | col.source("junit", path, "ok", len(rows)) |
| 410 | for label, path, rows in sets: | 413 | for label, path, rows, is_ctest in sets: |
| 411 | ran = os.path.getmtime(path) | 414 | ran = os.path.getmtime(path) |
| 412 | for name, res, secs, detail in rows: | 415 | for name, res, secs, detail in rows: |
| 413 | if res == "fail": | 416 | if res == "fail": |
| 414 | fresh, status = "failed", "failed" | 417 | fresh, status = "failed", "failed" |
| 415 | elif res == "skip": | 418 | elif res == "skip": |
| 416 | fresh, status = "unknown", "unknown" | 419 | fresh, status = "unknown", "unknown" |
| 417 | elif runtime_changed and ran < runtime_changed and label == "ctest": | 420 | elif is_ctest and runtime_changed and ran < runtime_changed: |
| 418 | fresh, status = "revalidation_required", "partial" | 421 | fresh, status = "revalidation_required", "partial" |
| 419 | else: | 422 | else: |
| 420 | fresh, status = "current", "verified" | 423 | fresh, status = "current", "verified" |
| @@ -424,7 +427,7 @@ def collect_ctest(col, args): | |||
| 424 | if seen: | 427 | if seen: |
| 425 | ok = sum(1 for c in col.components if c["panel"] == "runtime" and c["status"] == "verified") | 428 | ok = sum(1 for c in col.components if c["panel"] == "runtime" and c["status"] == "verified") |
| 426 | col.metric("runtime.current", "runtime", "Runtime tests passing on the current code", ok, seen, | 429 | col.metric("runtime.current", "runtime", "Runtime tests passing on the current code", ok, seen, |
| 427 | "tests that passed after the last commit touching runtime/ / tests recorded") | 430 | "passing tests, excluding CTest reports older than the last commit touching runtime/ / tests recorded") |
| 428 | 431 | ||
| 429 | 432 | ||
| 430 | # ----------------------------------------------------------------------------------------------- GPU tests | 433 | # ----------------------------------------------------------------------------------------------- GPU tests |