Skip to content

[1.4] beacon: add tests - #4594

Merged
joaoantoniocardoso merged 2 commits into
bluerobotics:1.4-devfrom
patrickelectric:add-beacon-tests-14
Oct 15, 2026
Merged

joaoantoniocardoso merged 2 commits into
bluerobotics:1.4-devfrom
patrickelectric:add-beacon-tests-14

Conversation

@patrickelectric

Copy link
Copy Markdown
Member

Backport of the beacon tests to 1.4-dev.

Cherry-pick of #4570

@github-actions

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: LGTM :shipit:

Backport of PR #4570 to 1.4-dev: adds core/services/beacon/test_beacon.py (300 lines, test-only, no source behavior change). Spot-checked the referenced symbols (AsyncRunner, AsyncZeroconf, Beacon, get_services, get_ip, Interface, InvalidIpAddress, SettingsV4 with VERSION = 4, InterfaceType.{WIFI,HOTSPOT,WIRED,USB,UNKNOWN}, IpInfo) and the default-settings.json domain-name expectations against origin/1.4-dev — all match. Test deps (pytest-asyncio==0.14.0, psutil==5.7.2, zeroconf, starlette) are already pinned in the 1.4-dev workspace, so pre-push should stay green.

No further comments, nice job 👍

Generated by PR Review Bot. This is advisory, a human reviewer must still approve.

@joaoantoniocardoso

Copy link
Copy Markdown
Member
_____________ ERROR collecting core/services/beacon/test_beacon.py _____________
ImportError while importing test module '/home/runner/work/BlueOS/BlueOS/core/services/beacon/test_beacon.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.11.17/x64/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
core/services/beacon/test_beacon.py:14: in <module>
    from starlette.requests import Request
E   ModuleNotFoundError: No module named 'starlette'

The 1.4 test environment does not provide starlette, fastapi, uvicorn,
zeroconf or commonwealth, so the tests failed at import time.
Replace them with stand-ins and load the real commonwealth settings
manager by path, keeping the settings tests meaningful.

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
@joaoantoniocardoso
joaoantoniocardoso requested a review from a team October 15, 2026 14:36
@joaoantoniocardoso
joaoantoniocardoso merged commit ec0a76b into bluerobotics:1.4-dev Oct 15, 2026
6 checks passed
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.

3 participants