Skip to content

test: skip POSIX-only assertions on Windows with explicit reasons - #176

Open
dieterolson wants to merge 1 commit into
open-flight:mainfrom
dieterolson:test/windows-platform-skips
Open

test: skip POSIX-only assertions on Windows with explicit reasons#176
dieterolson wants to merge 1 commit into
open-flight:mainfrom
dieterolson:test/windows-platform-skips

Conversation

@dieterolson

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds skipif(os.name == "nt", ...) with explicit reasons to two tests that assert POSIX platform capabilities: the cloud-config 0600-permission check (tests/test_cloud_config.py) and the udev-alias resolution test (tests/test_serial_latency.py).

Why was this required?

Both tests fail on a Windows checkout for environmental reasons, not product bugs: POSIX permission bits aren't representable through st_mode on Windows, and the udev test's symlink_to needs elevation there. Together with the recently merged #171 and #172, this is part of getting a stock Windows checkout to zero unexplained failures — today contributors see red tests and learn to ignore them, which erodes the "tests must pass" signal. Skips with stated reasons make the environment limit explicit and keep the tests fully active on Linux/macOS (including the Pi, where the 0600 check actually matters).

Automated tests

Test-only change: the two modules report 12 passed / 2 skipped on Windows (previously 2 failed); on POSIX the skip conditions are false and nothing changes.

Manual (human) testing

  • Ran both modules on Windows 11 before (2 environment failures) and after (2 skips, reasons visible under -rs).
  • Verified the skip conditions target exactly the capability each test needs (mode-bit representability; unprivileged symlink creation) rather than blanket-skipping the modules — the other 12 tests still run on Windows.

Checklist

  • Single feature/fix — this PR is scoped to one thing with a clear story above
  • Automated tests included — test-only change; the modules are the coverage
  • Manual testing described — I documented what I verified by hand above
  • Python tests pass (uv run pytest tests/ -v)
  • Pylint passes (uv run pylint src/openflight/ --fail-under=9)
  • Ruff passes (uv run ruff check src/openflight/)
  • UI builds (cd ui && npm run build) — not applicable, no UI changes
  • UI lint passes (cd ui && npm run lint) — not applicable, no UI changes
  • Updated docs or CHANGELOG if needed — test-only, no changelog entry
  • No unrelated changes mixed in

Two tests assert platform capabilities rather than product logic on
Windows: the cloud-config 0600 permission check (POSIX mode bits) and
the udev-alias resolution test (symlink creation needs elevation).
Skip them with explicit reasons so a Windows checkout distinguishes
environment limits from real failures.
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.

1 participant