Repository navigation
ci(drift): wire the board-selection gate's test and shrink the budget - #1938
Merged
Merged
Conversation
`ci/test_select_boards.py` guards `ci/select_boards.py`, the dispatcher that decides which `build-<board>.yml` workflows a push runs (`ci-minimal.yml` PR matrix) and which ones the nightly sweep dispatches. `ci/gate_script_tests.toml` already claimed the coverage, but no entry point executed the module, so the claim was decorative and the dispatcher could rot silently. Wired into `DRIFT_UNITTEST_MODULES` (which also propagates to `ci/local_gate.py`) and the drift step; dropped from `KNOWN_UNWIRED`, `MAX_UNWIRED` 2 -> 1. Promoting it exposed the same seam as #1934-#1937: the 15 existing tests drove `select_workflows`/`matrix_entries` only, so the whole fail-open boundary and the CLI were untested. An unknown diff (empty base, ZERO_SHA, failed `git diff`) exists precisely so platform coverage is NOT silently skipped after a force-push; nothing asserted it. Added 7 tests: - empty base and ZERO_SHA return None without invoking git - a failed `git diff` returns None and explains itself on stderr - a successful diff forwards the exact argv and drops blank lines - `main()` with an unknown diff prints every board and exits 0 - `--all` never consults the diff at all - `--base`/`--head` are forwarded to the diff - `--matrix` emits template_build records (workflow, test_dir, toolchain_cache)
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
What
ci/test_select_boards.pyguardsci/select_boards.py— the dispatcher that decides whichbuild-<board>.ymlworkflows a push runs (ci-minimal.ymlbuilds its PR matrix from it) and which onesnightly-platforms.ymldispatches.ci/gate_script_tests.tomlalready named it as the covering test, sogate_script_coveragewas green, but no entry point executed the module — a decorative guard on the seam that decides whether a board is built at all.Wired into
DRIFT_UNITTEST_MODULES(single source of truth; also propagates toci/local_gate.py) and the drift step, dropped fromKNOWN_UNWIRED,MAX_UNWIRED2 → 1.Why the wiring PR also adds tests
Promoting it exposed the same gap as #1934–#1937: all 15 existing tests drove
select_workflows/matrix_entries; the CLI and its fail-open boundary had none.select_boards.pydeliberately treats an unknown diff as "select every board" so a force-push or a rewound base cannot silently stop platform coverage. Nothing asserted that — inverting it to[]would pass every existing test and quietly retire the per-board builds.Added 7 tests:
ZERO_SHANonewithout invoking gitgit diffNone+ explains on stderrmain()unknown diffmain() --allmain() --base/--headmain() --matrixVerification (real output)
python -m unittest ci.test_select_boards→ 22 tests OK (was 15)ci.test_local_suites+ci.test_gate_script_coverage→ 23 OKci/gate_script_coverage.py --budget 0→ rc 0, "Every workflow-invoked gate script is accounted for"ruff check→ clean;ci/check_python_complexity.py→ clean;ci/render_workflows.py --check→ rc 0RED (mutation, each restored afterwards):
changed_filesempty-base →[]:test_missing_or_zero_base_…fails[]:test_failed_git_diff_…fails ([] is not None)test_successful_diff_drops_blank_linesfails--allstill diffs:test_all_skips_the_diff_entirelyfails--matrixbranch disabled:test_matrix_flag_…failstest_drift_workflow_step_matches_registryfails2 not less than or equal to 1