Skip to content

dashboard: keep CTest verdicts with explicit reasons (BUILD-1192) - #4194

Open
olegmkrv wants to merge 1 commit into
ItsNotRexed:mainfrom
olegmkrv:build-1192-lasttest-reasons
Open

olegmkrv wants to merge 1 commit into
ItsNotRexed:mainfrom
olegmkrv:build-1192-lasttest-reasons

Conversation

@olegmkrv

Copy link
Copy Markdown

Claimed as BUILD-1192 in #4084 (finding).

parse_lasttest dropped every verdict that carries an explicit reason: CTest replaces the plain Test Passed./Test Failed. line with Test Pass Reason:/Test Fail Reason: plus the reason text. A pass reason is now a pass unless its text is a skip (Skip regular expression ...); a fail reason is a fail.

Confirmed against real LastTest.log files from local CTest 4.5.1 (synthetic projects using PASS_REGULAR_EXPRESSION, FAIL_REGULAR_EXPRESSION, SKIP_REGULAR_EXPRESSION, SKIP_RETURN_CODE, TIMEOUT): all rows kept, skip-via-regex reads as skip. Checked first: open #4124, #2681, #4010 touch nearby code but none touches parse_lasttest.

Tested: python3 -I -B tests/test_progress_dashboard.py -> 27 pass (26 existing + 1 new); git diff --check clean. Python only, no game files or GPU. AI-assisted.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this at 41ac9724 on Windows 11: pytest tests/test_progress_dashboard.py -q -> 27 passed, 6 subtests passed; git diff --check clean.

parse_lasttest now reads the Test Pass Reason: / Test Fail Reason: pair CTest writes when a verdict carries a reason: a pass reason is a pass unless its text starts with Skip, and a fail reason is a fail. The existing plain ... Passed/Failed lines and the malformed---tests validation still pass. No blocking issue.

@Vonsek

Vonsek commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 41ac972 on Windows 11 (Ryzen 9 9950X3D; CPU only, no GPU used), Python 3.12.10: python -I tests/test_progress_dashboard.py 27/27 OK; python -I tests/semantic/test_wave64_halves.py (also in this branch's diff) 79/79 OK. I did not parse a real LastTest.log from a CTest run with pass or fail reasons.

AI-assisted.

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

This branch has two commits, and the second one isn't BUILD-1192. acd24ad3 ("wave64: scalar side effects in a voted branch refuse tier A (SHADER-742)") is the head of your own open #4156. It brings tools/wave64_halves.py, tests/semantic/test_wave64_halves.py and the docs/design.md row with it, none of which the description mentions.

The dashboard fix doesn't need it. Cherry-picked alone onto main aa2988cc, 41ac9724 applies cleanly (2 files), and python -I tests/test_progress_dashboard.py passes 27/27. With main's tools/progress_dashboard.py, test_lasttest_log_keeps_explicit_reasons fails, so the new test covers the fix.

Rebasing onto main without acd24ad3 would keep SHADER-742 reviewed only in #4156. If you'd rather keep the stack, add Depends on: #4156 to the description.

Linux, Python 3.12.16. AI-assisted (Devin).

@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 41ac972 on Windows, CPython 3.14.7, CTest 4.4.3, CPU only (no GPU, no game files).

python -m pytest -q tests/test_progress_dashboard.py tests/semantic/test_wave64_halves.py gives 106 tests passed and 6 subtests passed. I used a virtual environment with tests/requirements.txt. With the two changed implementation files from the merge base (aa2988c), 5 tests fail.

I found one defect. The dashboard can change a failed CTest test to a pass. The parser reads the output of the test process as a verdict.
In this script, a real CTest test prints the two lines Test Pass Reason: and setup completed, and then fails:

import pathlib, runpy, shutil, subprocess, tempfile, xml.etree.ElementTree as ET
parse = runpy.run_path("tools/progress_dashboard.py")["parse_lasttest"]
with tempfile.TemporaryDirectory() as d:
    p = pathlib.Path(d)
    cmake = pathlib.Path(shutil.which("cmake")).as_posix()
    (p / "CTestTestfile.cmake").write_text(f'add_test(summary "{cmake}" -P summary.cmake)\n')
    (p / "summary.cmake").write_text('message("Test Pass Reason:")\nmessage("setup completed")\nmessage(FATAL_ERROR "final check failed")\n')
    rc = subprocess.run(["ctest", "--output-junit", "result.xml"], cwd=d, capture_output=True).returncode
    case = ET.parse(p / "result.xml").find(".//testcase")
    print("CTest", rc, case.get("status"), "dashboard", parse((p / "Testing/Temporary/LastTest.log").read_text()))

Actual result: CTest returns 8 and its JUnit file says fail. The dashboard gives [('summary', 'pass', None)].
Expected result: fail, with the duration. The merge base gives this result for the same test.

Possible correction: read the verdict from the CTest footer after the timing line. A failing test that prints a reason header can pin it.
#4184 changes the same parser for a different case.

AI-assisted.

parse_lasttest dropped rows whose verdict carries Test Pass/Fail
Reason: a pass reason is a pass unless its text is a skip, a fail
reason is a fail. Synthetic LastTest.log regression test.

AI-assisted.
@olegmkrv
olegmkrv force-pushed the build-1192-lasttest-reasons branch from 41ac972 to 74c7913 Compare November 23, 2026 00:21
@olegmkrv

Copy link
Copy Markdown
Author

@ray3242 done: rebased onto main without acd24ad3 — the branch now holds only the dashboard commit (2 files: tools/progress_dashboard.py, tests/test_progress_dashboard.py). SHADER-742 stays reviewed in #4156. Verified after rebase: python -I -B tests/test_progress_dashboard.py 27/27 OK, git diff --check clean. AI-assisted.

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Thanks @olegmkrv. At 74c79132 the branch has the dashboard commit only (2 files). It merges cleanly with main, and python -I tests/test_progress_dashboard.py passes, so the SHADER-742 overlap with #4156 is gone. This doesn't cover @shdann's verdict-parsing report above.

Linux, Python 3.12.16. AI-assisted (Devin).

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

shdann's verdict-parsing defect is still there on 74c79132 (the diff to parse_lasttest is unchanged by the rebase). Reproduced without CMake, using a LastTest.log entry in CTest's layout: the test's output, between Output: and <end of output>, has a Test Pass Reason: line, and the footer says Test Failed.:

('summary', 'pass', None)      <- 74c79132; CTest's verdict is Failed
('summary', 'fail', 0.02)      <- with the change below

The reason lines are only CTest's when they come after <end of output>, so skipping the output section is enough:

    out, name, secs, reason, in_output = [], None, None, None, False
    for line in text.splitlines():
        if line == "Output:" or line.startswith("<end of output>"):
            in_output = line == "Output:"
            continue
        if in_output:
            continue

With that, the same log still gives pass for a footer Test Pass Reason: / Required regular expression found, skip for Skip regular expression found, pass for a plain Test Passed., and tests/test_progress_dashboard.py stays 27/27. Gating on Test time = instead would break this PR's own test_lasttest_log_keeps_explicit_reasons, whose fixture leaves that line out. A test entry with an Output: section would pin the defect.

Linux, Python 3.12.16, no CMake. AI-assisted (Devin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants