Skip to content

fix(test): answer the OTA peer run's apply criterion in its success-path mock - #4399

Merged
zackees merged 1 commit into
masterfrom
fix/ota-peer-test-mock
Sep 12, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/ota-peer-test-mock

Conversation

@zackees

@zackees zackees commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

master is red: ci/tests/test_autoresearch_net.py::test_ota_peer_stages_artifact_without_a_host_wifi_manager has failed on every push since #4318 merged.

Cause

#4318 added the run's final criterion — ask the RP whether it applied the image, because the C6 having served it only proves a download happened (#3956):

applied = await rpc_data(primary, "rpOtaUpdateStatus", {})
if not ota_applied_ok(applied):
    raise RuntimeError(f"RP2350W did not apply the artifact it fetched: {applied}; ...")

It did not update this test. The primary_after mock answers every method with a blanket {"success": True}, and ota_applied_ok requires attempted is True and succeeded is True — neither is present, so it reads "not proven" and fails. Which is the criterion working as designed; the fixture simply never answered the new question.

Note the shape: a mock that says yes to everything is exactly what #4318 exists to stop counting as proof, so the right fix is to make it dispatch on method rather than to loosen the criterion.

Fix

primary_after_send now dispatches, answering rpOtaUpdateStatus the way a board that applied the image would, and keeping the blanket success for the other calls.

Verification

  • uv run pytest ci/tests/test_autoresearch_net.py — 25 passed (was 24 passed, 1 failed).
  • Load-bearing: flipping succeeded to False in the new mock fails the test, so it still exercises the criterion rather than papering over it.
  • bash lint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

Summary by CodeRabbit

  • Bug Fixes
    • Updated OTA update test behavior to correctly represent successful update results.
    • Preserved fallback success handling for other update operations.

…ath mock

#4318 gave the peer-OTA run a final criterion: ask the RP whether it
actually applied the image, because the C6 having served it only proves a
download happened (#3956). It did not update this test, whose
`primary_after` mock answers every method with a blanket
`{"success": True}` -- which `ota_applied_ok` reads as not proven,
correctly, since neither `attempted` nor `succeeded` is present. master
has been red on `test_ota_peer_stages_artifact_without_a_host_wifi_manager`
since that merge.

The mock now dispatches on method and answers `rpOtaUpdateStatus` the way
a board that applied the image would. Verified load-bearing: flipping
`succeeded` to False fails the test.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
@zackees
zackees merged commit d53d53b into master Sep 12, 2026
24 of 25 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 12, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 12, 2026
@coderabbitai

coderabbitai Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 04a28a52-8721-42ec-8e07-8a51165dd5e2

📥 Commits

Reviewing files that changed from the base of the PR and between 1206aab and b5ad8b6.

📒 Files selected for processing (1)
  • ci/tests/test_autoresearch_net.py

📝 Walkthrough

Walkthrough

The OTA test’s post-update primary-board mock now returns explicit success status data for rpOtaUpdateStatus. Other methods retain the generic success response.

Changes

OTA test behavior

Layer / File(s) Summary
Model successful OTA status
ci/tests/test_autoresearch_net.py
The post-update mock returns attempted and succeeded flags for rpOtaUpdateStatus. Other methods continue to return generic success responses.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ota-peer-test-mock

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees deleted the fix/ota-peer-test-mock branch November 5, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant