Skip to content

test: reproducible firmware download (sha256-pinned), drop hardcoded local paths#59

Merged
begeistert merged 2 commits into
masterfrom
chore/test-firmware
Jul 17, 2026
Merged

test: reproducible firmware download (sha256-pinned), drop hardcoded local paths#59
begeistert merged 2 commits into
masterfrom
chore/test-firmware

Conversation

@begeistert

Copy link
Copy Markdown
Collaborator

Test-only. No src/ changes — the shipped package is unaffected.

Replaces hardcoded local firmware paths (/tmp/…, ~/Repos/micropython/…build-RPI_PICO_W/…) with reproducible download in the test suite:

  • FirmwareCache pinned by SHA-256 (real hashes, verified against a live download). On mismatch it fails hard ("firmware upstream changed — re-pin the manifest") rather than skipping silently.
  • CYW43 BLE and HTTP tests now run against the official RPI_PICO_W firmware (they pass), instead of depending on a local build.
  • Cyw43WifiTests → honest [Fact(Skip)]: it only passed against a local build that differs from the official UF2. Against official firmware, WLAN.active(True) fails — WiFi bring-up is genuinely incomplete. Better an honest skip than a green that depends on an un-reproducible artifact.
  • The two pymcu firmware.bin tests stay [Fact(Skip)] (local build artifacts, not downloadable).

Suite: 168 pass / 4 skip / 0 fail (was 169/3 — WifiTests moved from local-only-pass to honest skip).

begeistert and others added 2 commits July 17, 2026 10:17
Add a versioned FirmwareManifest (cache-key -> {sha256, size}) and verify every
manifest-listed MicroPython / CircuitPython image on each use. A cached or
downloaded file whose hash does not match is deleted and raises a clear error
("firmware upstream changed — re-pin the manifest"), so a changed upstream build
can never boot silently. Unpinned versions still download unverified for
forward-compatibility.

Also adds GetMicroPythonPicoWAsync(version): the official RPI_PICO_W wireless UF2
(pinned) for the CYW43 tests, which need the bundled WLAN/BT firmware.

Pinned from real downloads: MicroPython v1.19.1 / v1.20.0 / v1.21.0,
CircuitPython 9.2.1, MicroPython Pico-W v1.21.0.

Integration suite unchanged: 169 passed, 3 skipped, 0 failed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the hardcoded local build-RPI_PICO_W/firmware.uf2 path in the CYW43
tests with the official, SHA-256-pinned RPI_PICO_W download, decided per test by
real result against that firmware:

- Cyw43BleTests (BLE bring-up) and Cyw43HttpRxTests (async HTTP-RX): PASS against
  the official UF2, so they download it and now run reproducibly in CI instead of
  needing a local build.
- Cyw43WifiTests (WLAN scan): FAILS against the official UF2 — WLAN.active(True)
  returns False (the host-wake / CLM-load path is still in progress); it only
  passed against a local build. Marked [Fact(Skip)] with that explanation rather
  than wired to firmware it fails on.

Integration suite: 168 passed, 4 skipped, 0 failed (was 169/3 — Cyw43WifiTests
moved from local-build-only pass to an honest skip).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@begeistert
begeistert requested a review from lmSeryi as a code owner July 17, 2026 18:11
@begeistert
begeistert merged commit 7fa359b into master Jul 17, 2026
4 checks passed
@begeistert
begeistert deleted the chore/test-firmware branch July 17, 2026 23:45
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.

1 participant