Skip to content

ci: add pytest to requirements.txt - #229

Merged
techmore merged 5 commits into
mainfrom
fix/ci-pytest-dep
Aug 22, 2026
Merged

ci: add pytest to requirements.txt#229
techmore merged 5 commits into
mainfrom
fix/ci-pytest-dep

Conversation

@techmore

@techmore techmore commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

CI has never been green on this repo (every run since June failed). This PR makes CI actually runnable and fixes real test debt discovered along the way.

Fixes

  • pytest missing from requirements.txt - all three jobs failed with pytest: command not found
  • Socket auth bypass for tests (NMAPUI_SOCKET_AUTH_DISABLED=1) - the token check rejected flask_socketio test clients and browser pages; set in the browser-regression fixture and CI
  • 5 pre-existing failures fixed in test_reporting_modules.py - stale March 2026 timestamps fell outside max_days=30; tests now compute recent timestamps (baseline failures 21 -> 16)
  • test_admin_scripts: use sys.executable instead of repo .venv/bin/python
  • unit job installs xsltproc for the report fixture test
  • browser regressions: domcontentloaded instead of networkidle (CDN scripts keep network busy past goto timeout)
  • templates/index.html bootstrap race (found via headless debugging): connected without the loopback token and ran DOMContentLoaded handlers before the async socket existed - crashed with "Cannot read properties of undefined (reading 'on')". Both runtimes now wait for socket connect before wiring modules. Verified: zero page errors, socket connects, reports list populates.

Remaining known-red (pre-existing, out of scope)

  • ~16 runtime-contract tests assert frontend content that only exists on the swift-native branch (contract drift between branches)
  • 7 browser regression tests fail due to shared-server/test-client interplay; standalone reproduction works. Tracked for follow-up.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Sean Dolbec added 4 commits August 22, 2026 15:08
…ing tests

- CI failed because pytest was missing from requirements.txt and the new
  Socket.IO auth rejected flask_socketio test clients and Playwright pages.
  Adds NMAPUI_SOCKET_AUTH_DISABLED env bypass, set in the browser-regression
  fixture and CI workflow.
- Repairs 4 pre-existing test failures in test_reporting_modules.py: fixed
  March 2026 timestamps fell outside max_days=30 as real time passed. Tests
  now compute recent timestamps at module load. Failures drop 21 -> 17.
- test_admin_scripts: use sys.executable instead of repo .venv path
- CI unit job: install xsltproc for the representative report fixture test
- test_reporting_modules: fix remaining stale-timestamp JSON quoting so
  newer scans sort correctly (all 5 pre-existing failures in this file
  are now green; total baseline failures 21 -> 16)
CDN scripts (tailwind/socket.io CDN) keep the network busy past the
default 30s goto timeout in CI environments; domcontentloaded plus the
existing element waits are sufficient and deterministic.
…strap

templates/index.html connected without the loopback token so every
socket was rejected once #210 landed; it also had a startup race where
DOMContentLoaded handlers ran before the async socket existed (crash:
'Cannot read properties of undefined (reading on)'). Now both runtimes
wait for socket connect before wiring modules. Verified headless: zero
page errors, socket connects, reports list populates.
@techmore
techmore merged commit 3acbbcf into main Aug 22, 2026
1 of 3 checks passed
@techmore
techmore deleted the fix/ci-pytest-dep branch August 22, 2026 20:28
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