Skip to content

[ci] Create annotations for failed ctests/gtests in pull requests - #23799

Open
muntasir-396 wants to merge 1 commit into
root-project:masterfrom
muntasir-396:ci/annotate-failed-ctests
Open

muntasir-396 wants to merge 1 commit into
root-project:masterfrom
muntasir-396:ci/annotate-failed-ctests

Conversation

@muntasir-396

Copy link
Copy Markdown

Summary

Fixes #18475.

Problem

When tests fail in CI, developers must scroll through thousands of lines in the CI logs to locate the failure.

Solution

  • Added extract_ctest_annotations and annotate_ctest_failures in build_utils.py to parse failed test logs (LastTestsFailed.log and LastTest.log).
  • Emits GitHub Actions ::error annotations with exact file and line locations for:
    • Google Test (gtest) failures
    • C++/macro errors in roottest
    • Python test tracebacks in roottest
    • Fallback workflow annotations for tests without file/line matches
  • Excluded Windows to prevent duplicate annotations caused by test reruns.
  • Added comprehensive unit tests in test_annotate_failures.py and hooked them into test-ci-scripts.yml.

Checklist

  • Unit tests pass locally (python3 test_annotate_failures.py and test_null_build_check.py)
  • Tested with mocked GTest, C++ macro, and Python traceback logs

Fixes root-project#18475

Parse failed test blocks from CTest logs (LastTestsFailed.log and LastTest.log)
and emit GitHub Actions ::error annotations mapping failing tests directly to
the relevant source file and line (e.g. gtest failures, macro errors, and Python
tracebacks in roottest). Exclude Windows to prevent duplicate annotations
on test reruns.
@muntasir-396
muntasir-396 requested a review from dpiparo as a code owner October 22, 2026 14:11

This branch has not been deployed

No deployments
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.

[ci] Avoid scrolling 10k lines: Failed ctests/gtests could create annotation in (un)changed files

1 participant