Repository navigation
test(build_report): unit tests for zulip_build_report.py - #73
Draft
jessealama wants to merge 2 commits into
Draft
jessealama wants to merge 2 commits into
jessealama wants to merge 2 commits into
Conversation
jessealama
force-pushed
the
weekly-lint-report-tests
branch
from
September 28, 2026 03:04
7c12d28 to
e8cf37e
Compare
Add scripts/reporting/zulip_build_report.py, a successor to zulip_build_report.sh with the same environment-variable contract and stdout/stderr shape. The shell script is left untouched for the nightly-testing workflows that still call it. The script is a thin entry point; the implementation is the scripts/reporting/build_report/ package, one module per responsibility (Lake log parsing, report context, Zulip rendering, job-summary rendering, CLI), following the layout of scripts/zulip/reconcile_emojis.py. Compared to the shell script it: - parses whole messages, including continuation lines, Lake's failure epilogue, and stderr panic blocks, as Lake actually prints them; - attributes each message to a linter via the `set_option linter.X false` (or `0`) note that logLint appends, keeping the rest visible under "(not attributed to a linter)"; - posts a compact Zulip message: the shell script's headline, severity bullets, and error/panic tables, plus a per-linter count table instead of per-message warning/info tables, with the spoiler tables capped so the message stays under Zulip's limit even for a badly broken build; - writes the full per-occurrence detail to GITHUB_STEP_SUMMARY, one section per linter, each row linking to the source at the built commit when the file exists in the package directory, budgeted against GitHub's 1 MiB cap including what the step already wrote. The code targets Python 3.8, since the self-hosted runners' Python is not pinned. Tests follow in a separate PR to keep this one small to review.
Tests in tests/build_report/ use trimmed real logs from a Mathlib and a CSLib weekly run plus a synthetic failed build; test_build_report.yml runs them on Python 3.8 (the floor, since the self-hosted runners' Python is not pinned) and latest. Split out of the PR that adds the script, at reviewer request, to keep that one small to review.
jessealama
force-pushed
the
weekly-lint-report-tests
branch
from
October 5, 2026 03:02
e8cf37e to
5d96753
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are the tests that were split off from #70, at reviewer request. Stacked on #70, so the diff includes that commit until it merges.
I'm open to feedback on whether unit-testing CI scripts this way is worth it here, or whether the usual small-script-plus-fix-in-production approach is preferred.