Skip to content

ci_select: fix the membrowse test's env dependence, and stop HIL unit tests taking the rig - #3846

Merged
hathach merged 2 commits into
masterfrom
claude/ci-membrowse-test-ci-flag
Aug 25, 2026
Merged

ci_select: fix the membrowse test's env dependence, and stop HIL unit tests taking the rig#3846
hathach merged 2 commits into
masterfrom
claude/ci-membrowse-test-ci-flag

Conversation

@hathach

@hathach hathach commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Follow-up to #3845, which merged while its last CI run was still red: pre-commit fails
on master right now.

test_the_upload_board_can_diverge_from_the_built_board is the test that pins how many
families the membrowse $EX_ARGS removal gave up data on. It called
get_family_boards without ci=True, so it pinned whichever set the developer's machine
produced — and the CI skip lists are off by default locally, which moves the --one-first
pick on three families:

set families
local imxrt lpc11 lpc18 lpc54 mcx rp2040 rx samd11 stm32l0 stm32l4 tm4c
the runner imxrt lpc11 lpc18 lpc54 mcx rx samd11 samd2x_l2x samd5x_e5x stm32l0 stm32l4 tm4c

rp2040 diverges only locally; samd2x_l2x and samd5x_e5x only on the runner. So the
assertion held on my machine and went red on its first CI run.

Pass ci=True unconditionally, exactly as ci_select._prune_buildable already does and
for the same reason — the question is what CI will do, so it must not change with
GITHUB_ACTIONS being set — and pin the runner's twelve.

The measured trade in #3845 is unaffected: it is twelve families rather than eleven, and
rp2040 was never one of them.

Verified green both bare and under GITHUB_ACTIONS=true CI=true; pre-commit run --all-files green.

Also: the harness's own tests stop taking the rig

Noticed on this PR's own CI run — a one-line test fix booked the full 27-board rig.

Rule 2 is a bare test/hil/ prefix, so test/hil/test/** matches it. But that directory
holds the harness's unit tests, not the harness. Nothing on the rig runs them:
pre-commit does (.pre-commit-config.yaml:73,88), and build.yml:88,779 runs
test_ci_select.py as the gate before trusting a selection at all.

Carved out to rule 1b, where test/{fuzz,unit-test}/** already sits for the same reason.

diff before after
test/hil/test/test_ci_*.py 27 boards, all tests nothing
test/hil/hil_test.py 27 boards, all tests unchanged
test/hil/tinyusb.json 27 boards, all tests unchanged

test/hil/ itself is untouched: the harness and the rosters decide what the rig does, so
they cannot be trusted to narrow their own blast radius.

The carve-out is a claim about that directory's contents rather than about any one file,
so a test pins its file list — anything added there that the rig does read fails the
suite instead of silently skipping hardware. Both directions are pinned, and I verified
each new guard actually fires by breaking it.

Rule table updated in the spec and in the module docstring, which is a cell-for-cell
carbon of it (that guard fires too — checked by editing the spec alone).

The new divergence test called get_family_boards without ci=True, so it
pinned whichever set the developer's machine produced. The CI skip lists are
off by default locally and change the one-first pick on three families, so
the assertion held here and went red on its first CI run: rp2040 is only
diverging locally, samd2x_l2x and samd5x_e5x only on the runner.

Pass ci=True unconditionally, as _prune_buildable already does for the same
reason - this models the step being described, which always runs on CI - and
pin the runner's twelve.
Copilot AI lite review requested due to automatic review settings August 25, 2026 02:57
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Size Difference Report

Because TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds.

Note: If there is no change, only one value is shown.

Changes >1% in size

No entries.

Changes <1% in size

No entries.

No changes
file .text .rodata .data .bss size % diff
audio_device.c 2885 0 1252 1621 4501 +0.0%
cdc_device.c 1235 16 1092 722 1955 +0.0%
cdc_host.c 6475 487 15 926 7607 +0.0%
dcd_ch32_usbfs.c 1708 0 0 1364 3072 +0.0%
dcd_ch32_usbhs.c 1922 0 0 481 2404 +0.0%
dcd_ci_fs.c 1955 0 0 1290 3245 +0.0%
dcd_ci_hs.c 1941 0 0 779 2721 +0.0%
dcd_da146xx.c 3067 0 0 144 3211 +0.0%
dcd_dwc2.c 4230 19 0 265 4514 +0.0%
dcd_eptri.c 2281 0 0 259 2540 +0.0%
dcd_ft9xx.c 3284 0 0 172 3456 +0.0%
dcd_lpc17_40.c 1842 0 0 792 2238 +0.0%
dcd_lpc_ip3511.c 1580 0 0 264 1800 +0.0%
dcd_mm32f327x_otg.c 1474 0 0 1290 2764 +0.0%
dcd_msp430x5xx.c 1801 0 0 176 1977 +0.0%
dcd_musb.c 2667 0 0 179 2846 +0.0%
dcd_nrf5x.c 2974 0 0 292 3266 +0.0%
dcd_nuc120.c 1096 0 0 78 1174 +0.0%
dcd_nuc121.c 1170 0 0 101 1271 +0.0%
dcd_nuc505.c 0 0 1533 157 1690 +0.0%
dcd_rp2040.c 1004 0 764 653 2420 +0.0%
dcd_rusb2.c 3346 0 0 156 3502 +0.0%
dcd_samd.c 1071 0 0 266 1337 +0.0%
dcd_samg.c 1326 0 0 72 1398 +0.0%
dcd_stm32_fsdev.c 2568 0 0 291 2859 +0.0%
dfu_device.c 776 28 712 134 910 +0.0%
dfu_rt_device.c 157 0 134 0 157 +0.0%
dwc2_common.c 603 22 0 0 615 +0.0%
ecm_rndis_device.c 1067 0 1 2759 3826 +0.0%
ehci.c 2763 0 0 6274 7783 +0.0%
fsdev_common.c 182 0 0 0 182 +0.0%
hcd_ch32_usbfs.c 2491 0 0 502 2993 +0.0%
hcd_ci_fs.c 2466 0 0 469 2936 +0.0%
hcd_ci_hs.c 186 0 0 0 186 +0.0%
hcd_dwc2.c 5071 25 1 545 5642 +0.0%
hcd_musb.c 3071 0 0 157 3228 +0.0%
hcd_pio_usb.c 262 0 240 0 502 +0.0%
hcd_rp2040.c 1996 17 4 321 2338 +0.0%
hcd_rusb2.c 2951 0 0 245 3196 +0.0%
hcd_samd.c 2168 0 0 324 2492 +0.0%
hcd_stm32_fsdev.c 3248 0 1 420 3670 +0.0%
hid_device.c 1121 44 997 119 1240 +0.0%
hid_host.c 1244 0 0 1287 2531 +0.0%
hub.c 1380 8 8 30 1414 +0.0%
midi2_device.c 3608 34 1600 563 4183 +0.0%
midi2_host.c 1798 0 0 5876 7674 +0.0%
midi_device.c 1148 0 1007 614 1759 +0.0%
midi_host.c 1338 7 7 3449 4791 +0.0%
msc_device.c 2522 108 2293 802 3325 +0.0%
msc_host.c 1620 0 0 395 2015 +0.0%
mtp_device.c 1781 22 771 589 2378 +0.0%
ncm_device.c 1791 28 833 4393 6197 +0.0%
ohci.c 2157 0 0 2503 4660 +0.0%
printer_device.c 827 0 706 555 1380 +0.0%
rp2040_usb.c 386 35 632 11 1065 +0.0%
rusb2_common.c 160 0 16 0 176 +0.0%
tusb.c 449 0 389 3 451 +0.0%
tusb_fifo.c 855 0 486 0 850 +0.0%
typec_stm32.c 1230 8 2 19 1255 +0.0%
usbc.c 500 2 20 166 688 +0.0%
usbd.c 3708 57 92 354 4126 +0.0%
usbh.c 4971 57 81 1174 6244 +0.0%
usbtmc_device.c 2283 24 69 311 2625 +0.0%
vendor_device.c 1132 0 538 1561 2685 +0.0%
video_device.c 4477 5 1245 480 4949 +0.0%
TOTAL 126846 1053 17541 50194 179085 +0.0%

Copilot AI 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.

🟢 Approval recommended

The change is narrowly scoped to a test fix, uses the existing ci override supported by get_family_boards, and aligns the assertion with runner behavior to prevent CI-only failures.

Pull request overview

This PR fixes a CI-vs-local discrepancy in the HIL CI-metrics test suite by ensuring the “membrowse upload board divergence” test queries board selection as CI would (using CI skip/preferred lists), so the pinned family set is stable and matches runner behavior.

Changes:

  • Pass ci=True to build.get_family_boards() in test_the_upload_board_can_diverge_from_the_built_board so the test reflects runner board selection rather than a developer machine’s default.
  • Update the pinned expected “diverging families” set to the runner-derived 12-family set.
  • Expand the test docstring to document why CI behavior must be forced in this test.
File summaries
File Description
test/hil/test/test_ci_metrics.py Forces CI-mode board selection in the membrowse divergence test and updates the expected pinned family set accordingly.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@claude

claude Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Rule 2 is a bare `test/hil/` prefix, so test/hil/test/** was booking the full
27-board rig - roughly 11 minutes of exclusive hardware - for diffs that
cannot reach it. This PR did it to itself.

Nothing on the rig runs those files: pre-commit does, and build.yml runs
test_ci_select.py as the gate before trusting a selection at all. Carve them
out to rule 1b, where test/{fuzz,unit-test}/** already sits for the same
reason. test/hil/ itself is untouched and still forces the whole rig - the
harness and the rosters decide what the rig does, so they cannot be trusted
to narrow their own blast radius.

The carve-out is a claim about that directory's contents rather than about
any one file, so a test pins its file list: anything added there that the rig
does read fails the suite instead of silently skipping hardware. Two more
pin the behaviour in both directions.

Rule table updated in the spec and in the module docstring, which is a
cell-for-cell carbon of it.
@hathach hathach changed the title test: ask the membrowse board question as the runner, not as a developer ci_select: fix the membrowse test's env dependence, and stop HIL unit tests taking the rig Aug 25, 2026
@hathach
hathach merged commit b610ff0 into master Aug 25, 2026
332 of 334 checks passed
@hathach
hathach deleted the claude/ci-membrowse-test-ci-flag branch August 25, 2026 03:35
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected across 2510 targets. View Project Dashboard →

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants