Skip to content

test: add novaMock end-to-end test and fix stale unit tests - #11

Merged
Awesome-Ace22 merged 5 commits into
devfrom
tests/backend-test-suite
Oct 21, 2026
Merged

Awesome-Ace22 merged 5 commits into
devfrom
tests/backend-test-suite

Conversation

@Awesome-Ace22

@Awesome-Ace22 Awesome-Ace22 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Adds an end-to-end integration test (novaMock → real Mosquitto → backend → websocket client) and fixes the stale unit tests, so the whole suite passes and CI runs the integration test on every PR with coverage.

  • New tests/integration/: starts a private Mosquitto on a free localhost port, runs tools/novaMock.py against it, and checks that a websocket client receives calibrated engine_data for one GCS sensor (PGSO, calibrated to psi) and one FAS sensor (PCC, passed through unconverted). It's skipped if Mosquitto isn't installed, unless NOVA_REQUIRE_INTEGRATION is set.
  • Fixed unit tests: updated expectations that had gone stale since the move from node strings to board_type/board_id (b686c52):
    • FAS command envelopes now expect board_type/board_id instead of node.
    • resolved_node and sensor-parser expectations now match the board_id in each test's config (EPB_1, EPB_2).
    • Removed the two parse_system_command tests, because that method was removed from the app in b686c52.
  • CI: installs Mosquitto and pytest-cov, sets NOVA_REQUIRE_INTEGRATION=1 so the integration test fails rather than silently skipping, and prints coverage for app/.
  • Other changes: pytest-cov added to the dev extras, an integration pytest marker registered, coverage output gitignored, and CONTRIBUTING.md updated with the new test command and Mosquitto requirement.
  • Closes Get the backend test suite green and add simulator integration tests Nova-Collected#2

How was this tested?

  • 1 Unit / Automated Test - CI
  • 2 Simulator Test - testing procedure with the hardware simulators
  • 3 Bench Test - testing procedure on the dev stack, with some real hardware
  • 4 Integration Test - full engine test procedure, real hardware, no propellants

python -m pytest -q -rs on this branch: 83 passed, 0 skipped. The integration test ran against a local Mosquitto install. The only warning is starlette's existing deprecation notice about httpx.

Hardware impact

  • None - UI, docs or tooling only
  • Changes how a sensor is read, converted or shown
  • Changes how an actuator is commanded, or safety rules, interlocks, timeouts or sequencing → add the hardware-risk label; a lead must approve
  • Changes a message format, MQTT topic or FAS protocol that another repo depends on → title needs !, link the matching PRs:

No app code changes; tests, CI and docs only.

Checklist

  • Targets dev (or main for a release/hotfix, or with a reason given above)
  • Branch is up to date ("Update branch" button)
  • No station config/calibrations, data files, secrets, .env files or build output committed
  • README/docs updated if behaviour changed

tests/integration starts a private Mosquitto broker and tools/novaMock.py,
runs the backend against them, and checks that a websocket client gets
calibrated engine_data for one GCS and one FAS sensor, both in the
connect-time snapshot and in a live broadcast.

The test is skipped when Mosquitto isn't installed. CI installs it and
sets NOVA_REQUIRE_INTEGRATION=1 so the test fails there instead of
silently skipping.
tests/integration starts a private Mosquitto broker and tools/novaMock.py,
runs the backend against them, and checks that a websocket client gets
calibrated engine_data for one GCS and one FAS sensor, both in the
connect-time snapshot and in a live broadcast.

The test is skipped when Mosquitto isn't installed. CI installs it and
sets NOVA_REQUIRE_INTEGRATION=1 so the test fails there instead of
silently skipping.
_config_file checked names with Path, which on Linux doesn't treat \ as a
separator, so "..\secret.yaml" passed as a bare file name and the request
got a 404 instead of a 400. CI (Linux) failed
test_load_and_download_reject_paths_outside_config_dir for this.

Check with PureWindowsPath instead, which treats / and \ as separators
and C: as a drive on every OS, so Linux and Windows reject the same names.
@Awesome-Ace22
Awesome-Ace22 merged commit 14caad6 into dev Oct 21, 2026
2 checks passed
@Awesome-Ace22
Awesome-Ace22 deleted the tests/backend-test-suite branch October 21, 2026 15:42
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.

Get the backend test suite green and add simulator integration tests

1 participant