test: reproducible firmware download (sha256-pinned), drop hardcoded local paths#59
Merged
Conversation
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>
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.
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:RPI_PICO_Wfirmware (they pass), instead of depending on a local build.[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.pymcufirmware.bintests 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).