Repository navigation
fix(ops243): make missing-radar port hint tool-neutral - #292
Merged
Merged
Conversation
The "No OPS243 radar found on USB" error told users to pass --radar-port, which only start-kiosk.sh accepts. The hardware-test scripts the UART build guide sends you to take --port instead, so following the hint produced "unrecognized arguments: --radar-port". The driver cannot know which CLI invoked it, so the hint now says to pass the serial port via your command's port option instead of naming a specific flag. Adds a test pinning that the message names neither flag. Fixes open-flight#270
8 of 10 tasks
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 does this PR do?
Rewords the
ConnectionErrorraised when no OPS243 is auto-detected on USB so it no longer names--radar-port. The hint now says to pass the serial port via your command's port option, e.g./dev/ttyAMA0.Fixes #270
Why was this required?
The UART build guide (
docs/build/ops243-uart.md) walks you throughscripts/hardware-test/test_rolling_buffer_persist.py. After the required power cycle, running--testwith no--portfails with a message telling you to pass--radar-port /dev/ttyAMA0. That flag belongs tostart-kiosk.sh; the test script only accepts--port, so following the hint produceserror: unrecognized arguments: --radar-port. A user got stuck here and reported it in #270.The driver (
src/openflight/ops243.py) cannot know which CLI called it, so swapping one flag name for the other would just mislead the other set of callers. The message is now tool-neutral.Automated tests
Added
test_missing_radar_error_does_not_name_a_caller_specific_flagintests/test_ops243_uart.py. It mocksfind_radar_portsto return nothing, callsconnect(), and asserts theConnectionErrortext contains neither--radar-portnor--port. Written first and confirmed failing against the old message, then passing after the fix. The existing test that the message still mentionsttyAMA0continues to pass.Manual (human) testing
Ran the exact command from the issue on a Mac with no radar connected:
Observed the new message at the end of the traceback:
Unlike before, following the hint no longer leads to
unrecognized arguments: --radar-port, because no flag is named.Full suite:
uv run pytest tests/gives 1625 passed, 13 failed. All 13 failures are intest_camera_*and fail identically onmainin my environment becausecv2is not installed; unrelated to this change.uv run pylint src/openflight/ops243.pyscores 9.91.ruff checkpasses on changed files. No UI changes.Checklist
uv run pytest tests/ -v)uv run pylint src/openflight/ --fail-under=9)uv run ruff check src/openflight/)cd ui && npm run build) — no UI changescd ui && npm run lint) — no UI changes