From d78e1f58dc2174c50e06a8b9482e9b5c3017690b Mon Sep 17 00:00:00 2001 From: mouldybread <38598858+mouldybread@users.noreply.github.com> Date: Sun, 29 Nov 2026 02:21:16 +0800 Subject: [PATCH 1/7] docs: add repository layout plan and ignore build artifacts (#16) --- .gitignore | 2 ++ docs/REPOSITORY_LAYOUT.md | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 docs/REPOSITORY_LAYOUT.md diff --git a/.gitignore b/.gitignore index 2863609..f73829f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /tmp eventburp.sh +/simplenvr +__pycache__/ diff --git a/docs/REPOSITORY_LAYOUT.md b/docs/REPOSITORY_LAYOUT.md new file mode 100644 index 0000000..d246248 --- /dev/null +++ b/docs/REPOSITORY_LAYOUT.md @@ -0,0 +1,17 @@ +# Repository layout (issue #16) + +Status: migration in progress. This page is updated to the final tree and move +inventory in the last batch. + +## Target layout + +- `cmd/simplenvr/` - all Go sources and Go tests (`package main`, unchanged) +- `web/templates/`, `web/static/` - HTML templates and static assets +- `tests/frontend/`, `tests/runtime/`, `tests/ci/` - Node suites, runtime acceptance scripts, CI helpers and their unit tests +- `tests/fixtures/`, `tests/evidence/` - unchanged +- `docs/` - documentation, including `docs/compose/` for Compose examples +- `.github/` - workflows and scripts (stay in place) +- Root: `go.mod`, `go.sum`, `Dockerfile`, `README.md`, `LICENSE.md`, `DISCLAIMER.md` + +Application behavior, runtime paths (`/recordings`, `/certs`, `/app/templates`, +`/app/static`) and test assertions do not change. From 43f1645456023c2f3f27fc7a1efc38c5b1561a49 Mon Sep 17 00:00:00 2001 From: mouldybread <38598858+mouldybread@users.noreply.github.com> Date: Sun, 29 Nov 2026 02:28:36 +0800 Subject: [PATCH 2/7] docs: move Docker Compose example to docs/compose (#16) --- README.md | 25 +------------------------ docs/compose/compose.yaml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 24 deletions(-) create mode 100644 docs/compose/compose.yaml diff --git a/README.md b/README.md index e2af9e8..acd10b3 100644 --- a/README.md +++ b/README.md @@ -6,30 +6,7 @@ SimpleNVR records RTSP cameras with FFmpeg. Use the web interface to manage came Use the image from GitHub Container Registry. The example defaults to `v0.2.2`, which includes built-in authentication and server-prepared exports. An image's release workflow must finish publishing before it can be pulled. -Save as `compose.yaml`: - -```yaml -services: - simplenvr: - image: ghcr.io/mouldybread/simplenvr:${SIMPLENVR_VERSION:-v0.2.2} - restart: unless-stopped - ports: - - "127.0.0.1:8443:443" - environment: - NVR_EXPORT_SCRATCH_DIR: /exports - volumes: - - type: bind - source: ./recordings - target: /recordings - bind: - create_host_path: false - - type: bind - source: ./exports - target: /exports - bind: - create_host_path: false - - ./certs:/certs -``` +The example Compose file is [docs/compose/compose.yaml](docs/compose/compose.yaml). Copy it into your install directory as `compose.yaml` before running the commands below, because its `./recordings`, `./exports` and `./certs` paths are relative to the Compose file. Optionally set `SIMPLENVR_VERSION` in `.env` to another published version that supports these features. Unlike the old example, this Compose file actually uses that setting. diff --git a/docs/compose/compose.yaml b/docs/compose/compose.yaml new file mode 100644 index 0000000..a9eb6a2 --- /dev/null +++ b/docs/compose/compose.yaml @@ -0,0 +1,20 @@ +services: + simplenvr: + image: ghcr.io/mouldybread/simplenvr:${SIMPLENVR_VERSION:-v0.2.2} + restart: unless-stopped + ports: + - "127.0.0.1:8443:443" + environment: + NVR_EXPORT_SCRATCH_DIR: /exports + volumes: + - type: bind + source: ./recordings + target: /recordings + bind: + create_host_path: false + - type: bind + source: ./exports + target: /exports + bind: + create_host_path: false + - ./certs:/certs From b7b1c961e7356e467124df9fff191782b8bcb613 Mon Sep 17 00:00:00 2001 From: mouldybread <38598858+mouldybread@users.noreply.github.com> Date: Sun, 29 Nov 2026 03:14:34 +0800 Subject: [PATCH 3/7] refactor: group tests into frontend and acceptance directories (#16) --- .github/workflows/prepared-export-browser.yml | 4 ++-- .github/workflows/prepared-export-go.yml | 4 ++-- .github/workflows/safety-ci.yml | 18 +++++++++--------- camera_removal_confirmation_frontend_test.go | 2 +- docs/PREPARED_EXPORT_VERIFICATION.md | 2 +- docs/REPOSITORY_LAYOUT.md | 3 ++- docs/STORAGE_DEPLOYMENT_BOUNDARIES.md | 2 +- .../AUDIT_EVIDENCE_ADDENDUM_2026-11-16.md | 2 +- ...EVENT_CORRESPONDENCE_EVIDENCE_ASSESSMENT.md | 2 +- docs/audit/EVENT_NVR_INGESTION_POLICY.md | 2 +- docs/audit/EXPORT_UI.md | 2 +- docs/audit/RUNTIME_BROWSER_ACCEPTANCE.md | 2 +- .../RUNTIME_EXPORT_BACKPRESSURE_ACCEPTANCE.md | 6 +++--- event_clear_confirmation_frontend_test.go | 2 +- export_mode_ui_test.go | 2 +- export_queue_details_frontend_test.go | 2 +- export_range_controls_frontend_test.go | 2 +- frontend_security_test.go | 6 +++--- legacy_download_test.go | 2 +- live_stream_names_frontend_test.go | 2 +- orphan_cleanup_reporting_frontend_test.go | 2 +- persistence_responses_frontend_test.go | 2 +- playback_continuation_frontend_test.go | 2 +- playback_controls_frontend_test.go | 4 ++-- playback_failures_frontend_test.go | 4 ++-- playback_lifecycle_frontend_test.go | 2 +- ...ding_deletion_confirmation_frontend_test.go | 2 +- session_expiry_frontend_test.go | 2 +- .../active-container-storage.sh | 2 +- .../{ => acceptance}/browser_ci_diagnostics.py | 0 .../{ => acceptance}/browser_network_ready.py | 0 .../browser_playback_control.py | 0 .../{ => acceptance}/browser_playback_edges.py | 0 .../browser_playback_transport.py | 0 tests/{ => acceptance}/capture-copy-media.py | 0 tests/{ => acceptance}/core-ci-evidence.sh | 4 ++-- tests/{ => acceptance}/core_ci_evidence.py | 0 .../correspondence_assessment.py | 0 .../prepared_export_protocol.py | 0 .../{ => acceptance}/qualify_ingestion_time.py | 2 +- .../runtime-browser-acceptance.py | 0 .../runtime-browser-acceptance.sh | 8 ++++---- .../runtime-browser-expanded.py | 0 .../runtime-export-acceptance.sh | 8 ++++---- .../runtime_export_acceptance.py | 0 .../runtime_export_diagnostics.py | 0 .../runtime_export_writer_observer.py | 0 .../test_browser_ci_diagnostics.py | 0 .../test_browser_network_ready.py | 0 .../test_browser_playback_control.py | 4 ++-- .../test_browser_playback_edges.py | 0 .../test_browser_playback_transport.py | 0 .../{ => acceptance}/test_core_ci_evidence.py | 2 +- .../test_correspondence_assessment.py | 0 .../test_prepared_export_protocol.py | 0 .../test_runtime_export_acceptance.py | 0 .../test_runtime_export_diagnostics.py | 2 +- .../test_runtime_export_observer_exit.py | 0 .../test_runtime_export_writer_observer.py | 0 .../camera-removal-confirmation.cjs | 0 tests/{ => frontend}/download-entrypoints.cjs | 0 .../event-clear-confirmation.cjs | 0 tests/{ => frontend}/event-navigation.cjs | 0 tests/{ => frontend}/event-rendering.cjs | 0 tests/{ => frontend}/export-mode-ui.cjs | 0 tests/{ => frontend}/export-queue-details.cjs | 0 tests/{ => frontend}/export-range-controls.cjs | 0 tests/{ => frontend}/export-ui-fixture.cjs | 2 +- tests/{ => frontend}/export-ui.cjs | 2 +- tests/{ => frontend}/live-stream-names.cjs | 0 .../orphan-cleanup-reporting.cjs | 0 tests/{ => frontend}/persistence-responses.cjs | 2 +- tests/{ => frontend}/playback-continuation.cjs | 0 tests/{ => frontend}/playback-controls.cjs | 0 tests/{ => frontend}/playback-failures.cjs | 0 tests/{ => frontend}/playback-lifecycle.cjs | 0 .../recording-deletion-confirmation.cjs | 0 tests/{ => frontend}/session-expiry.cjs | 0 .../{ => frontend}/timeline-camera-filter.cjs | 0 tests/{ => frontend}/timeline-canvas.cjs | 0 tests/{ => frontend}/timeline-geometry.cjs | 2 +- tests/{ => frontend}/toast-text.cjs | 0 timeline_camera_filter_frontend_test.go | 2 +- timeline_canvas_frontend_test.go | 2 +- timeline_geometry_frontend_test.go | 2 +- toast_text_frontend_test.go | 2 +- 86 files changed, 69 insertions(+), 68 deletions(-) rename tests/{ => acceptance}/active-container-storage.sh (98%) rename tests/{ => acceptance}/browser_ci_diagnostics.py (100%) rename tests/{ => acceptance}/browser_network_ready.py (100%) rename tests/{ => acceptance}/browser_playback_control.py (100%) rename tests/{ => acceptance}/browser_playback_edges.py (100%) rename tests/{ => acceptance}/browser_playback_transport.py (100%) rename tests/{ => acceptance}/capture-copy-media.py (100%) rename tests/{ => acceptance}/core-ci-evidence.sh (94%) rename tests/{ => acceptance}/core_ci_evidence.py (100%) rename tests/{ => acceptance}/correspondence_assessment.py (100%) rename tests/{ => acceptance}/prepared_export_protocol.py (100%) rename tests/{ => acceptance}/qualify_ingestion_time.py (98%) rename tests/{ => acceptance}/runtime-browser-acceptance.py (100%) rename tests/{ => acceptance}/runtime-browser-acceptance.sh (92%) rename tests/{ => acceptance}/runtime-browser-expanded.py (100%) rename tests/{ => acceptance}/runtime-export-acceptance.sh (92%) rename tests/{ => acceptance}/runtime_export_acceptance.py (100%) rename tests/{ => acceptance}/runtime_export_diagnostics.py (100%) rename tests/{ => acceptance}/runtime_export_writer_observer.py (100%) rename tests/{ => acceptance}/test_browser_ci_diagnostics.py (100%) rename tests/{ => acceptance}/test_browser_network_ready.py (100%) rename tests/{ => acceptance}/test_browser_playback_control.py (97%) rename tests/{ => acceptance}/test_browser_playback_edges.py (100%) rename tests/{ => acceptance}/test_browser_playback_transport.py (100%) rename tests/{ => acceptance}/test_core_ci_evidence.py (99%) rename tests/{ => acceptance}/test_correspondence_assessment.py (100%) rename tests/{ => acceptance}/test_prepared_export_protocol.py (100%) rename tests/{ => acceptance}/test_runtime_export_acceptance.py (100%) rename tests/{ => acceptance}/test_runtime_export_diagnostics.py (98%) rename tests/{ => acceptance}/test_runtime_export_observer_exit.py (100%) rename tests/{ => acceptance}/test_runtime_export_writer_observer.py (100%) rename tests/{ => frontend}/camera-removal-confirmation.cjs (100%) rename tests/{ => frontend}/download-entrypoints.cjs (100%) rename tests/{ => frontend}/event-clear-confirmation.cjs (100%) rename tests/{ => frontend}/event-navigation.cjs (100%) rename tests/{ => frontend}/event-rendering.cjs (100%) rename tests/{ => frontend}/export-mode-ui.cjs (100%) rename tests/{ => frontend}/export-queue-details.cjs (100%) rename tests/{ => frontend}/export-range-controls.cjs (100%) rename tests/{ => frontend}/export-ui-fixture.cjs (99%) rename tests/{ => frontend}/export-ui.cjs (99%) rename tests/{ => frontend}/live-stream-names.cjs (100%) rename tests/{ => frontend}/orphan-cleanup-reporting.cjs (100%) rename tests/{ => frontend}/persistence-responses.cjs (98%) rename tests/{ => frontend}/playback-continuation.cjs (100%) rename tests/{ => frontend}/playback-controls.cjs (100%) rename tests/{ => frontend}/playback-failures.cjs (100%) rename tests/{ => frontend}/playback-lifecycle.cjs (100%) rename tests/{ => frontend}/recording-deletion-confirmation.cjs (100%) rename tests/{ => frontend}/session-expiry.cjs (100%) rename tests/{ => frontend}/timeline-camera-filter.cjs (100%) rename tests/{ => frontend}/timeline-canvas.cjs (100%) rename tests/{ => frontend}/timeline-geometry.cjs (97%) rename tests/{ => frontend}/toast-text.cjs (100%) diff --git a/.github/workflows/prepared-export-browser.yml b/.github/workflows/prepared-export-browser.yml index e765d70..1ff87ad 100644 --- a/.github/workflows/prepared-export-browser.yml +++ b/.github/workflows/prepared-export-browser.yml @@ -43,8 +43,8 @@ jobs: - name: Protocol regressions and real HTTPS/browser acceptance run: | . "$RUNNER_TEMP/export-browser-venv/bin/activate" - python -m unittest discover -s tests -p 'test_prepared_export_protocol.py' -v - GITHUB_SHA="$CHECKPOINT_SHA" bash tests/runtime-browser-acceptance.sh simplenvr-export-test "$RUNNER_TEMP/prepared-export-browser" + python -m unittest discover -s tests/acceptance -p 'test_prepared_export_protocol.py' -v + GITHUB_SHA="$CHECKPOINT_SHA" bash tests/acceptance/runtime-browser-acceptance.sh simplenvr-export-test "$RUNNER_TEMP/prepared-export-browser" - name: Retain media, network, browser and container evidence if: always() uses: actions/upload-artifact@v4 diff --git a/.github/workflows/prepared-export-go.yml b/.github/workflows/prepared-export-go.yml index 5514a0c..d32ea1d 100644 --- a/.github/workflows/prepared-export-go.yml +++ b/.github/workflows/prepared-export-go.yml @@ -39,7 +39,7 @@ jobs: - run: bash .github/scripts/ci-media-apt.sh update - run: bash .github/scripts/ci-media-apt.sh install ffmpeg - name: Prepared protocol regression tests - run: python3 -m unittest discover -s tests -p 'test_prepared_export_protocol.py' -v + run: python3 -m unittest discover -s tests/acceptance -p 'test_prepared_export_protocol.py' -v - name: Verify dependencies and build the exact checkout run: | go mod download @@ -47,7 +47,7 @@ jobs: git diff --exit-code -- go.mod go.sum go build ./... - name: Full race-enabled Go suite including Node and native media tests - run: GITHUB_SHA="$CHECKPOINT_SHA" bash tests/core-ci-evidence.sh "$RUNNER_TEMP/prepared-export-go" + run: GITHUB_SHA="$CHECKPOINT_SHA" bash tests/acceptance/core-ci-evidence.sh "$RUNNER_TEMP/prepared-export-go" - name: Static analysis if: always() run: go vet ./... diff --git a/.github/workflows/safety-ci.yml b/.github/workflows/safety-ci.yml index ae0f2a2..a58e495 100644 --- a/.github/workflows/safety-ci.yml +++ b/.github/workflows/safety-ci.yml @@ -31,8 +31,8 @@ jobs: persist-credentials: false - name: Browser CI diagnostic helper regression tests run: | - python3 -m unittest discover -s tests -p 'test_browser_ci_diagnostics.py' -v - python3 -m unittest discover -s tests -p 'test_browser_network_ready.py' -v + python3 -m unittest discover -s tests/acceptance -p 'test_browser_ci_diagnostics.py' -v + python3 -m unittest discover -s tests/acceptance -p 'test_browser_network_ready.py' -v - uses: actions/setup-go@v5 with: go-version: '1.26.x' @@ -51,10 +51,10 @@ jobs: - name: Build run: go build ./... - name: Core evidence assessor regression tests - run: python3 -m unittest discover -s tests -p 'test_core_ci_evidence.py' -v + run: python3 -m unittest discover -s tests/acceptance -p 'test_core_ci_evidence.py' -v - name: Race-enabled tests including media and shutdown lifecycle shell: bash - run: GITHUB_SHA="$CHECKPOINT_SHA" bash tests/core-ci-evidence.sh "$RUNNER_TEMP/simplenvr-core-evidence" + run: GITHUB_SHA="$CHECKPOINT_SHA" bash tests/acceptance/core-ci-evidence.sh "$RUNNER_TEMP/simplenvr-core-evidence" - name: Retain core test execution evidence even on failure if: always() uses: actions/upload-artifact@v4 @@ -100,7 +100,7 @@ jobs: run: docker build -t simplenvr-safety-test . - name: Active runtime-container recording, SIGTERM and restart intent shell: bash - run: GITHUB_SHA="$CHECKPOINT_SHA" bash tests/active-container-storage.sh simplenvr-safety-test + run: GITHUB_SHA="$CHECKPOINT_SHA" bash tests/acceptance/active-container-storage.sh simplenvr-safety-test - name: Runtime container SIGTERM smoke test shell: bash run: | @@ -126,7 +126,7 @@ jobs: - name: Runtime export backpressure, disconnect, SIGTERM and restart timeout-minutes: 6 shell: bash - run: GITHUB_SHA="$CHECKPOINT_SHA" bash tests/runtime-export-acceptance.sh simplenvr-safety-test "$RUNNER_TEMP/simplenvr-export-evidence" + run: GITHUB_SHA="$CHECKPOINT_SHA" bash tests/acceptance/runtime-export-acceptance.sh simplenvr-safety-test "$RUNNER_TEMP/simplenvr-export-evidence" - name: Retain runtime-export evidence even on failure if: always() uses: actions/upload-artifact@v4 @@ -173,7 +173,7 @@ jobs: run: | set -euo pipefail . "$RUNNER_TEMP/simplenvr-browser-venv/bin/activate" - GITHUB_SHA="$CHECKPOINT_SHA" bash tests/runtime-browser-acceptance.sh simplenvr-safety-test "$RUNNER_TEMP/simplenvr-browser-evidence" + GITHUB_SHA="$CHECKPOINT_SHA" bash tests/acceptance/runtime-browser-acceptance.sh simplenvr-safety-test "$RUNNER_TEMP/simplenvr-browser-evidence" - name: Retain runtime-browser acceptance evidence if: always() uses: actions/upload-artifact@v4 @@ -238,13 +238,13 @@ jobs: git diff --exit-code -- go.mod go.sum - name: Evidence assessment regression tests if: always() - run: python3 -m unittest discover -s tests -p 'test_correspondence_assessment.py' -v + run: python3 -m unittest discover -s tests/acceptance -p 'test_correspondence_assessment.py' -v - name: Assess full adapter and native prebuffer evidence if: always() shell: bash run: | set -euo pipefail - python3 tests/correspondence_assessment.py "$RUNNER_TEMP/correspondence-resources" \ + python3 tests/acceptance/correspondence_assessment.py "$RUNNER_TEMP/correspondence-resources" \ --expected-head "$CHECKPOINT_SHA" \ --output "$RUNNER_TEMP/correspondence-resources/assessment.json" \ --summary "$RUNNER_TEMP/correspondence-resources/assessment.md" diff --git a/camera_removal_confirmation_frontend_test.go b/camera_removal_confirmation_frontend_test.go index 2dbc383..224da38 100644 --- a/camera_removal_confirmation_frontend_test.go +++ b/camera_removal_confirmation_frontend_test.go @@ -3,5 +3,5 @@ package main import "testing" func TestFrontendCameraRemovalConfirmation(t *testing.T) { - runFrontendRegression(t, "tests/camera-removal-confirmation.cjs", "UTC") + runFrontendRegression(t, "tests/frontend/camera-removal-confirmation.cjs", "UTC") } diff --git a/docs/PREPARED_EXPORT_VERIFICATION.md b/docs/PREPARED_EXPORT_VERIFICATION.md index 1c83f5a..6ecee31 100644 --- a/docs/PREPARED_EXPORT_VERIFICATION.md +++ b/docs/PREPARED_EXPORT_VERIFICATION.md @@ -41,4 +41,4 @@ Passing synthetic acceptance is not production-camera, full-resolution, multi-Gi The live browser fixture has a single camera, so queuing several cameras from the UI in one request and the 8-camera client limit are covered by the Node UI tests, not by live Chrome. The server's capacity limit is exercised live through the API, with several jobs for the same camera. -The older routed-response harness `tests/browser-export-acceptance.py` has been removed. It targeted the retired direct-download flow and was not run by any workflow. The live-runtime entrypoint is `tests/runtime-browser-acceptance.py`, invoked through the expanded playback runner. +The older routed-response harness `tests/browser-export-acceptance.py` has been removed. It targeted the retired direct-download flow and was not run by any workflow. The live-runtime entrypoint is `tests/acceptance/runtime-browser-acceptance.py`, invoked through the expanded playback runner. diff --git a/docs/REPOSITORY_LAYOUT.md b/docs/REPOSITORY_LAYOUT.md index d246248..a59aab6 100644 --- a/docs/REPOSITORY_LAYOUT.md +++ b/docs/REPOSITORY_LAYOUT.md @@ -7,7 +7,8 @@ inventory in the last batch. - `cmd/simplenvr/` - all Go sources and Go tests (`package main`, unchanged) - `web/templates/`, `web/static/` - HTML templates and static assets -- `tests/frontend/`, `tests/runtime/`, `tests/ci/` - Node suites, runtime acceptance scripts, CI helpers and their unit tests +- `tests/frontend/` - Node (`*.cjs`) frontend suites +- `tests/acceptance/` - Python helpers and their unit tests, and the shell acceptance scripts - `tests/fixtures/`, `tests/evidence/` - unchanged - `docs/` - documentation, including `docs/compose/` for Compose examples - `.github/` - workflows and scripts (stay in place) diff --git a/docs/STORAGE_DEPLOYMENT_BOUNDARIES.md b/docs/STORAGE_DEPLOYMENT_BOUNDARIES.md index dbe0210..37ca74c 100644 --- a/docs/STORAGE_DEPLOYMENT_BOUNDARIES.md +++ b/docs/STORAGE_DEPLOYMENT_BOUNDARIES.md @@ -41,7 +41,7 @@ It creates only a uniquely named synthetic scratch directory, then removes that ## Active runtime-container CI fixture -The added CI step builds on the unchanged runtime Dockerfile and runs tests/active-container-storage.sh against that exact CI-built image. It requires active continuous and event-buffer FFmpeg processes, continuous output bytes and at least two prebuffer segments before SIGTERM. It checks clean container exit, persisted restart intent for both cameras, a new nonempty published partial per stop, transient-buffer cleanup and byte-identical synthetic retained event inputs/checkpoints. It repeats start/stop in the same container to exercise persisted restart intent. +The added CI step builds on the unchanged runtime Dockerfile and runs tests/acceptance/active-container-storage.sh against that exact CI-built image. It requires active continuous and event-buffer FFmpeg processes, continuous output bytes and at least two prebuffer segments before SIGTERM. It checks clean container exit, persisted restart intent for both cameras, a new nonempty published partial per stop, transient-buffer cleanup and byte-identical synthetic retained event inputs/checkpoints. It repeats start/stop in the same container to exercise persisted restart intent. The fixture uses the real application, Alpine runtime and real FFmpeg, a read-only root, writable recordings/certs/tmp mounts, dropped capabilities except NET_BIND_SERVICE, no-new-privileges and no networking. A wrapper replaces RTSP input with a paced looping synthetic file. It does not validate Dahua RTSP disconnect/reconnect, queued event capture/assembly in the runtime image, authenticated export traffic, genuine browser behavior, physical storage or production mount-loss handling. It checks published partial presence, not complete footage. Synthetic fixture directories are removed by the test; production evidence is never touched. Existing empty-camera SIGTERM smoke and all prior media/storage tests remain enabled. diff --git a/docs/audit/AUDIT_EVIDENCE_ADDENDUM_2026-11-16.md b/docs/audit/AUDIT_EVIDENCE_ADDENDUM_2026-11-16.md index 2b17534..a2a3cad 100644 --- a/docs/audit/AUDIT_EVIDENCE_ADDENDUM_2026-11-16.md +++ b/docs/audit/AUDIT_EVIDENCE_ADDENDUM_2026-11-16.md @@ -37,7 +37,7 @@ CSRF proof, cross-tab idempotency, or deletion permission. ## Failed runtime-export campaign at 926dd03 The user-provided output identifies the command as -`bash tests/runtime-export-acceptance.sh simplenvr-safety-test "$RUNNER_TEMP/simplenvr-export-evidence"`. +`bash tests/acceptance/runtime-export-acceptance.sh simplenvr-safety-test "$RUNNER_TEMP/simplenvr-export-evidence"`. | Campaign case | Reported state | | --- | --- | diff --git a/docs/audit/EVENT_CORRESPONDENCE_EVIDENCE_ASSESSMENT.md b/docs/audit/EVENT_CORRESPONDENCE_EVIDENCE_ASSESSMENT.md index 7539aa6..71ab5a1 100644 --- a/docs/audit/EVENT_CORRESPONDENCE_EVIDENCE_ASSESSMENT.md +++ b/docs/audit/EVENT_CORRESPONDENCE_EVIDENCE_ASSESSMENT.md @@ -17,7 +17,7 @@ tail-latency claims. Background lifetime CPU is separate; zero kernel block operations do not prove zero logical reads. No host threshold is invented. Usage: -python3 tests/correspondence_assessment.py EXTRACTED_ARTIFACT_DIRECTORY \ +python3 tests/acceptance/correspondence_assessment.py EXTRACTED_ARTIFACT_DIRECTORY \ --expected-head FULL_COMMIT_SHA --output assessment.json --summary assessment.md The workflow runs regression tests and assessment after resource collection, diff --git a/docs/audit/EVENT_NVR_INGESTION_POLICY.md b/docs/audit/EVENT_NVR_INGESTION_POLICY.md index 5d3e924..9e2027f 100644 --- a/docs/audit/EVENT_NVR_INGESTION_POLICY.md +++ b/docs/audit/EVENT_NVR_INGESTION_POLICY.md @@ -51,7 +51,7 @@ or deployment is included. Run manually with stock ffmpeg/ffprobe and libx264/AAC available: - python3 tests/qualify_ingestion_time.py ingestion-qualification.json + python3 tests/acceptance/qualify_ingestion_time.py ingestion-qualification.json This developer tool generates three seconds of H.264 B-frames and AAC and sends it over loopback UDP/MPEG-TS with deliberately non-UTC source timestamps. It compares diff --git a/docs/audit/EXPORT_UI.md b/docs/audit/EXPORT_UI.md index cb0737c..0801b5f 100644 --- a/docs/audit/EXPORT_UI.md +++ b/docs/audit/EXPORT_UI.md @@ -24,4 +24,4 @@ Server reason codes (output_limit, estimate_exceeded, deadline_exceeded, empty_o ## Tests and limits -Node tests (tests/export-ui.cjs, tests/export-mode-ui.cjs, tests/export-range-controls.cjs, tests/export-queue-details.cjs, tests/download-entrypoints.cjs) exercise the real module with a stub DOM, the real timeline geometry helper and stubbed fetch/streams. They are not browser tests. tests/runtime-browser-acceptance.py drives the panel in Chrome against a container in CI, including the queue list and its download link, Clear all, the range handles with a real mouse and keyboard, and the server's capacity limit. Browser download restrictions, filesystem failures and media completeness of saved files remain unverified. Real-browser/authenticated export integration, storage-failure validation and final whole-branch review remain required under AUDIT_ACCEPTANCE.md. +Node tests (tests/frontend/export-ui.cjs, tests/frontend/export-mode-ui.cjs, tests/frontend/export-range-controls.cjs, tests/frontend/export-queue-details.cjs, tests/frontend/download-entrypoints.cjs) exercise the real module with a stub DOM, the real timeline geometry helper and stubbed fetch/streams. They are not browser tests. tests/acceptance/runtime-browser-acceptance.py drives the panel in Chrome against a container in CI, including the queue list and its download link, Clear all, the range handles with a real mouse and keyboard, and the server's capacity limit. Browser download restrictions, filesystem failures and media completeness of saved files remain unverified. Real-browser/authenticated export integration, storage-failure validation and final whole-branch review remain required under AUDIT_ACCEPTANCE.md. diff --git a/docs/audit/RUNTIME_BROWSER_ACCEPTANCE.md b/docs/audit/RUNTIME_BROWSER_ACCEPTANCE.md index badc0b3..ce9c2e8 100644 --- a/docs/audit/RUNTIME_BROWSER_ACCEPTANCE.md +++ b/docs/audit/RUNTIME_BROWSER_ACCEPTANCE.md @@ -34,7 +34,7 @@ CI uploads the commit/image/browser report, saved synthetic whole-copy and trim For an explicit local run with Docker, the image, Python Playwright/Chromium and host FFmpeg installed: - bash tests/runtime-browser-acceptance.sh IMAGE EVIDENCE_DIRECTORY + bash tests/acceptance/runtime-browser-acceptance.sh IMAGE EVIDENCE_DIRECTORY The driver generates and cleans its own application state. It does not run against an arbitrary existing production server. It requires sudo for synthetic container-owned state cleanup. Do not point its fixture storage at deployment evidence. diff --git a/docs/audit/RUNTIME_EXPORT_BACKPRESSURE_ACCEPTANCE.md b/docs/audit/RUNTIME_EXPORT_BACKPRESSURE_ACCEPTANCE.md index a149c9d..e633452 100644 --- a/docs/audit/RUNTIME_EXPORT_BACKPRESSURE_ACCEPTANCE.md +++ b/docs/audit/RUNTIME_EXPORT_BACKPRESSURE_ACCEPTANCE.md @@ -7,11 +7,11 @@ defect is claimed and no production implementation is changed. ## Integrated batch -- tests/runtime-export-acceptance.sh owns an isolated synthetic state directory, +- tests/acceptance/runtime-export-acceptance.sh owns an isolated synthetic state directory, fixture generator, password initializer and hardened runtime container. -- tests/runtime_export_acceptance.py exercises authenticated real HTTPS exports, +- tests/acceptance/runtime_export_acceptance.py exercises authenticated real HTTPS exports, bounded ownership observations, disconnect, SIGTERM, persistence and restart. -- tests/test_runtime_export_acceptance.py contains 22 tooling regression methods. +- tests/acceptance/test_runtime_export_acceptance.py contains 22 tooling regression methods. - .github/workflows/safety-ci.yml runs the campaign as a mandatory core step after the existing recording/restart and SIGTERM smoke checks, then retains evidence with always(). The existing aggregate requires core. Both isolated Chrome diff --git a/event_clear_confirmation_frontend_test.go b/event_clear_confirmation_frontend_test.go index 3debbf5..f6ad6bd 100644 --- a/event_clear_confirmation_frontend_test.go +++ b/event_clear_confirmation_frontend_test.go @@ -3,5 +3,5 @@ package main import "testing" func TestFrontendEventClearConfirmation(t *testing.T) { - runFrontendRegression(t, "tests/event-clear-confirmation.cjs", "UTC") + runFrontendRegression(t, "tests/frontend/event-clear-confirmation.cjs", "UTC") } diff --git a/export_mode_ui_test.go b/export_mode_ui_test.go index e5117cd..f961a6a 100644 --- a/export_mode_ui_test.go +++ b/export_mode_ui_test.go @@ -4,6 +4,6 @@ import "testing" func TestPreparedExportModeUI(t *testing.T) { for _,zone:=range []string{"UTC","America/Chicago"} { - t.Run(zone,func(t *testing.T){runFrontendRegression(t,"tests/export-mode-ui.cjs",zone)}) + t.Run(zone,func(t *testing.T){runFrontendRegression(t,"tests/frontend/export-mode-ui.cjs",zone)}) } } diff --git a/export_queue_details_frontend_test.go b/export_queue_details_frontend_test.go index 59839a4..abbda5d 100644 --- a/export_queue_details_frontend_test.go +++ b/export_queue_details_frontend_test.go @@ -4,6 +4,6 @@ import "testing" func TestPreparedExportQueueDetailsUI(t *testing.T) { for _,zone:=range []string{"UTC","America/Chicago"} { - t.Run(zone,func(t *testing.T){runFrontendRegression(t,"tests/export-queue-details.cjs",zone)}) + t.Run(zone,func(t *testing.T){runFrontendRegression(t,"tests/frontend/export-queue-details.cjs",zone)}) } } diff --git a/export_range_controls_frontend_test.go b/export_range_controls_frontend_test.go index 4a535c7..4372262 100644 --- a/export_range_controls_frontend_test.go +++ b/export_range_controls_frontend_test.go @@ -4,6 +4,6 @@ import "testing" func TestExportRangeControlsFrontend(t *testing.T) { for _,zone:=range []string{"UTC","America/Chicago"} { - t.Run(zone,func(t *testing.T){runFrontendRegression(t,"tests/export-range-controls.cjs",zone)}) + t.Run(zone,func(t *testing.T){runFrontendRegression(t,"tests/frontend/export-range-controls.cjs",zone)}) } } diff --git a/frontend_security_test.go b/frontend_security_test.go index 9041aeb..862eb54 100644 --- a/frontend_security_test.go +++ b/frontend_security_test.go @@ -22,10 +22,10 @@ func runFrontendRegression(t *testing.T,script,zone string) { if err!=nil {t.Fatalf("frontend regressions failed (%s, %s): %v\n%s",script,zone,err,output)} } -func TestFrontendEventRendering(t *testing.T) {runFrontendRegression(t,"tests/event-rendering.cjs","UTC")} -func TestFrontendExportUI(t *testing.T) {runFrontendRegression(t,"tests/export-ui.cjs","UTC")} +func TestFrontendEventRendering(t *testing.T) {runFrontendRegression(t,"tests/frontend/event-rendering.cjs","UTC")} +func TestFrontendExportUI(t *testing.T) {runFrontendRegression(t,"tests/frontend/export-ui.cjs","UTC")} func TestFrontendEventNavigation(t *testing.T) { for _,zone:=range []string{"UTC","Asia/Hong_Kong","America/Chicago"} { - t.Run(zone,func(t *testing.T){runFrontendRegression(t,"tests/event-navigation.cjs",zone)}) + t.Run(zone,func(t *testing.T){runFrontendRegression(t,"tests/frontend/event-navigation.cjs",zone)}) } } diff --git a/legacy_download_test.go b/legacy_download_test.go index 21c6aea..8b3cc59 100644 --- a/legacy_download_test.go +++ b/legacy_download_test.go @@ -29,4 +29,4 @@ func TestNoLegacyDownloadCallsInAssets(t *testing.T) { if !bytes.Contains(page,[]byte(`onclick="startExportDownloads()"`)) {t.Fatal("monitored export entry point is not wired to the page")} } -func TestFrontendDownloadEntryPoints(t *testing.T) {runFrontendRegression(t,"tests/download-entrypoints.cjs","UTC")} +func TestFrontendDownloadEntryPoints(t *testing.T) {runFrontendRegression(t,"tests/frontend/download-entrypoints.cjs","UTC")} diff --git a/live_stream_names_frontend_test.go b/live_stream_names_frontend_test.go index 7aefbbf..c67298b 100644 --- a/live_stream_names_frontend_test.go +++ b/live_stream_names_frontend_test.go @@ -3,5 +3,5 @@ package main import "testing" func TestFrontendLiveStreamNames(t *testing.T) { - runFrontendRegression(t, "tests/live-stream-names.cjs", "UTC") + runFrontendRegression(t, "tests/frontend/live-stream-names.cjs", "UTC") } diff --git a/orphan_cleanup_reporting_frontend_test.go b/orphan_cleanup_reporting_frontend_test.go index 08c925a..be3ce15 100644 --- a/orphan_cleanup_reporting_frontend_test.go +++ b/orphan_cleanup_reporting_frontend_test.go @@ -3,5 +3,5 @@ package main import "testing" func TestFrontendOrphanCleanupReporting(t *testing.T) { - runFrontendRegression(t, "tests/orphan-cleanup-reporting.cjs", "UTC") + runFrontendRegression(t, "tests/frontend/orphan-cleanup-reporting.cjs", "UTC") } diff --git a/persistence_responses_frontend_test.go b/persistence_responses_frontend_test.go index b9e91d8..2507c36 100644 --- a/persistence_responses_frontend_test.go +++ b/persistence_responses_frontend_test.go @@ -3,5 +3,5 @@ package main import "testing" func TestFrontendPersistenceResponses(t *testing.T) { - runFrontendRegression(t, "tests/persistence-responses.cjs", "UTC") + runFrontendRegression(t, "tests/frontend/persistence-responses.cjs", "UTC") } diff --git a/playback_continuation_frontend_test.go b/playback_continuation_frontend_test.go index 7556711..8f2567e 100644 --- a/playback_continuation_frontend_test.go +++ b/playback_continuation_frontend_test.go @@ -5,7 +5,7 @@ import "testing" func TestFrontendPlaybackContinuation(t *testing.T) { for _, zone := range []string{"UTC", "Asia/Hong_Kong", "America/Chicago"} { t.Run(zone, func(t *testing.T) { - runFrontendRegression(t, "tests/playback-continuation.cjs", zone) + runFrontendRegression(t, "tests/frontend/playback-continuation.cjs", zone) }) } } diff --git a/playback_controls_frontend_test.go b/playback_controls_frontend_test.go index 6e21d25..b1e2344 100644 --- a/playback_controls_frontend_test.go +++ b/playback_controls_frontend_test.go @@ -3,6 +3,6 @@ package main import "testing" func TestFrontendPlaybackControls(t *testing.T) { - runFrontendRegression(t, "tests/playback-controls.cjs", "UTC") - runFrontendRegression(t, "tests/playback-controls.cjs", "America/Chicago") + runFrontendRegression(t, "tests/frontend/playback-controls.cjs", "UTC") + runFrontendRegression(t, "tests/frontend/playback-controls.cjs", "America/Chicago") } diff --git a/playback_failures_frontend_test.go b/playback_failures_frontend_test.go index 74be9f0..01d9a20 100644 --- a/playback_failures_frontend_test.go +++ b/playback_failures_frontend_test.go @@ -3,6 +3,6 @@ package main import "testing" func TestFrontendPlaybackFailures(t *testing.T) { - runFrontendRegression(t, "tests/playback-failures.cjs", "UTC") - runFrontendRegression(t, "tests/playback-failures.cjs", "America/Chicago") + runFrontendRegression(t, "tests/frontend/playback-failures.cjs", "UTC") + runFrontendRegression(t, "tests/frontend/playback-failures.cjs", "America/Chicago") } diff --git a/playback_lifecycle_frontend_test.go b/playback_lifecycle_frontend_test.go index 4ae4b9c..f914025 100644 --- a/playback_lifecycle_frontend_test.go +++ b/playback_lifecycle_frontend_test.go @@ -3,5 +3,5 @@ package main import "testing" func TestFrontendPlaybackLifecycle(t *testing.T) { - runFrontendRegression(t, "tests/playback-lifecycle.cjs", "UTC") + runFrontendRegression(t, "tests/frontend/playback-lifecycle.cjs", "UTC") } diff --git a/recording_deletion_confirmation_frontend_test.go b/recording_deletion_confirmation_frontend_test.go index d8ee2a9..e942e92 100644 --- a/recording_deletion_confirmation_frontend_test.go +++ b/recording_deletion_confirmation_frontend_test.go @@ -3,5 +3,5 @@ package main import "testing" func TestFrontendRecordingDeletionConfirmation(t *testing.T) { - runFrontendRegression(t, "tests/recording-deletion-confirmation.cjs", "UTC") + runFrontendRegression(t, "tests/frontend/recording-deletion-confirmation.cjs", "UTC") } diff --git a/session_expiry_frontend_test.go b/session_expiry_frontend_test.go index ecdbe3c..09d70fd 100644 --- a/session_expiry_frontend_test.go +++ b/session_expiry_frontend_test.go @@ -3,5 +3,5 @@ package main import "testing" func TestFrontendSessionExpiry(t *testing.T) { - runFrontendRegression(t, "tests/session-expiry.cjs", "UTC") + runFrontendRegression(t, "tests/frontend/session-expiry.cjs", "UTC") } diff --git a/tests/active-container-storage.sh b/tests/acceptance/active-container-storage.sh similarity index 98% rename from tests/active-container-storage.sh rename to tests/acceptance/active-container-storage.sh index 0de96fe..0a97c99 100644 --- a/tests/active-container-storage.sh +++ b/tests/acceptance/active-container-storage.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -image=${1:?usage: bash tests/active-container-storage.sh IMAGE} +image=${1:?usage: bash tests/acceptance/active-container-storage.sh IMAGE} work=$(mktemp -d "${RUNNER_TEMP:-/tmp}/simplenvr-active-container.XXXXXX") state=$work/state fixture=$work/fixture diff --git a/tests/browser_ci_diagnostics.py b/tests/acceptance/browser_ci_diagnostics.py similarity index 100% rename from tests/browser_ci_diagnostics.py rename to tests/acceptance/browser_ci_diagnostics.py diff --git a/tests/browser_network_ready.py b/tests/acceptance/browser_network_ready.py similarity index 100% rename from tests/browser_network_ready.py rename to tests/acceptance/browser_network_ready.py diff --git a/tests/browser_playback_control.py b/tests/acceptance/browser_playback_control.py similarity index 100% rename from tests/browser_playback_control.py rename to tests/acceptance/browser_playback_control.py diff --git a/tests/browser_playback_edges.py b/tests/acceptance/browser_playback_edges.py similarity index 100% rename from tests/browser_playback_edges.py rename to tests/acceptance/browser_playback_edges.py diff --git a/tests/browser_playback_transport.py b/tests/acceptance/browser_playback_transport.py similarity index 100% rename from tests/browser_playback_transport.py rename to tests/acceptance/browser_playback_transport.py diff --git a/tests/capture-copy-media.py b/tests/acceptance/capture-copy-media.py similarity index 100% rename from tests/capture-copy-media.py rename to tests/acceptance/capture-copy-media.py diff --git a/tests/core-ci-evidence.sh b/tests/acceptance/core-ci-evidence.sh similarity index 94% rename from tests/core-ci-evidence.sh rename to tests/acceptance/core-ci-evidence.sh index d2599c9..3f675a6 100644 --- a/tests/core-ci-evidence.sh +++ b/tests/acceptance/core-ci-evidence.sh @@ -8,7 +8,7 @@ expected_head=${GITHUB_SHA:?GitHub head required} package=$(go list .) media="$evidence/bframe-media" mkdir -p "$media/bin" -helper=$(pwd)/tests/capture-copy-media.py +helper=$(pwd)/tests/acceptance/capture-copy-media.py for tool in ffmpeg ffprobe; do printf '#!/bin/sh\nexec python3 "$SIMPLENVR_CAPTURE_HELPER" %s "$@"\n' "$tool" > "$media/bin/$tool" chmod 700 "$media/bin/$tool" @@ -47,7 +47,7 @@ with open(path,'w') as f: 'runtime_qualified':False,'cleanup_authorized':False},f,indent=2) f.write('\n') PY -python3 tests/core_ci_evidence.py "$evidence" --expected-head "$expected_head" +python3 tests/acceptance/core_ci_evidence.py "$evidence" --expected-head "$expected_head" test "$test_exit" -eq 0 test "$tee_exit" -eq 0 test "${focused_statuses[0]}" -eq 0 diff --git a/tests/core_ci_evidence.py b/tests/acceptance/core_ci_evidence.py similarity index 100% rename from tests/core_ci_evidence.py rename to tests/acceptance/core_ci_evidence.py diff --git a/tests/correspondence_assessment.py b/tests/acceptance/correspondence_assessment.py similarity index 100% rename from tests/correspondence_assessment.py rename to tests/acceptance/correspondence_assessment.py diff --git a/tests/prepared_export_protocol.py b/tests/acceptance/prepared_export_protocol.py similarity index 100% rename from tests/prepared_export_protocol.py rename to tests/acceptance/prepared_export_protocol.py diff --git a/tests/qualify_ingestion_time.py b/tests/acceptance/qualify_ingestion_time.py similarity index 98% rename from tests/qualify_ingestion_time.py rename to tests/acceptance/qualify_ingestion_time.py index 95e8b10..cc47575 100644 --- a/tests/qualify_ingestion_time.py +++ b/tests/acceptance/qualify_ingestion_time.py @@ -2,7 +2,7 @@ """Offline qualification of a CANDIDATE, not production ingestion-time support. Requires stock ffmpeg/ffprobe, libx264 and AAC. Uses generated media, temporary -files and loopback UDP only. Run: python3 tests/qualify_ingestion_time.py report.json +files and loopback UDP only. Run: python3 tests/acceptance/qualify_ingestion_time.py report.json Exit 0 means this limited fixture passed, 1 means candidate unqualified, 2 means infrastructure/fixture failure. None of these outcomes certifies RTSP or coverage. """ diff --git a/tests/runtime-browser-acceptance.py b/tests/acceptance/runtime-browser-acceptance.py similarity index 100% rename from tests/runtime-browser-acceptance.py rename to tests/acceptance/runtime-browser-acceptance.py diff --git a/tests/runtime-browser-acceptance.sh b/tests/acceptance/runtime-browser-acceptance.sh similarity index 92% rename from tests/runtime-browser-acceptance.sh rename to tests/acceptance/runtime-browser-acceptance.sh index d530cd7..b976b1d 100644 --- a/tests/runtime-browser-acceptance.sh +++ b/tests/acceptance/runtime-browser-acceptance.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -image=${1:?usage: bash tests/runtime-browser-acceptance.sh IMAGE EVIDENCE_DIR} +image=${1:?usage: bash tests/acceptance/runtime-browser-acceptance.sh IMAGE EVIDENCE_DIR} evidence=${2:?evidence directory required} work=$(mktemp -d "${RUNNER_TEMP:-/tmp}/simplenvr-runtime-browser.XXXXXX") state=$work/state @@ -16,7 +16,7 @@ cleanup() { sudo rm -rf -- "$work" } trap cleanup EXIT -timeout --kill-after=2 20 python3 -m unittest discover -s tests -p 'test_browser_playback*.py' -v \ +timeout --kill-after=2 20 python3 -m unittest discover -s tests/acceptance -p 'test_browser_playback*.py' -v \ 2>&1 | tee "$evidence/playback-edge-unit-tests.log" # Deterministic non-reordered video exercises the supported subsection-copy path. # The Go suite separately retains reordered-video refusal and accurate rendering. @@ -74,9 +74,9 @@ port=$(docker inspect -f '{{(index (index .NetworkSettings.Ports "443/tcp") 0).H image_id=$(docker image inspect -f '{{.Id}}' "$image") host_ifindex=$(docker exec "$name" cat /sys/class/net/eth0/iflink) [[ "$host_ifindex" =~ ^[1-9][0-9]*$ ]] -timeout --kill-after=10 340 python3 tests/browser_network_ready.py \ +timeout --kill-after=10 340 python3 tests/acceptance/browser_network_ready.py \ --ifindex "$host_ifindex" --evidence "$evidence" -- \ - python3 tests/runtime-browser-expanded.py \ + python3 tests/acceptance/runtime-browser-expanded.py \ --origin "https://127.0.0.1:$port" --container "$name" \ --commit "${GITHUB_SHA:-$(git rev-parse HEAD)}" --image-id "$image_id" --evidence "$evidence" docker stop --timeout 75 "$name" >/dev/null diff --git a/tests/runtime-browser-expanded.py b/tests/acceptance/runtime-browser-expanded.py similarity index 100% rename from tests/runtime-browser-expanded.py rename to tests/acceptance/runtime-browser-expanded.py diff --git a/tests/runtime-export-acceptance.sh b/tests/acceptance/runtime-export-acceptance.sh similarity index 92% rename from tests/runtime-export-acceptance.sh rename to tests/acceptance/runtime-export-acceptance.sh index 210ea5c..c721349 100644 --- a/tests/runtime-export-acceptance.sh +++ b/tests/acceptance/runtime-export-acceptance.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -image=${1:?usage: bash tests/runtime-export-acceptance.sh IMAGE EVIDENCE_DIR} +image=${1:?usage: bash tests/acceptance/runtime-export-acceptance.sh IMAGE EVIDENCE_DIR} evidence=${2:?evidence directory required} work=$(mktemp -d "${RUNNER_TEMP:-/tmp}/simplenvr-runtime-export.XXXXXX") state=$work/state @@ -12,7 +12,7 @@ cleanup() { status=$? cleanup_failed=0 # Keep safe failure facts visible before disposable fixture teardown. - timeout --kill-after=2 5 python3 tests/runtime_export_diagnostics.py \ + timeout --kill-after=2 5 python3 tests/acceptance/runtime_export_diagnostics.py \ "$evidence/runtime-export-report.json" | tee "$evidence/runtime-export-console-summary.json" || cleanup_failed=1 # No raw auth/proc/network captures. Keep a bounded completion-marker count # even when the campaign fails before it can finish its JSON report. @@ -37,7 +37,7 @@ PY exit "$status" } trap cleanup EXIT -timeout --kill-after=2 20 python3 -m unittest discover -s tests -p 'test_runtime_export*.py' -v \ +timeout --kill-after=2 20 python3 -m unittest discover -s tests/acceptance -p 'test_runtime_export*.py' -v \ 2>&1 | tee "$evidence/runtime-export-tooling-tests.log" # Deliberately complex, bounded, video-only input. Generate with the exact # runtime image, before applying the pacing shim to application exports. @@ -77,7 +77,7 @@ docker run -d --name "$name" --label simplenvr.safety.fixture=runtime-export \ --mount "type=bind,src=$state,dst=/recordings" \ --mount "type=bind,src=$bin,dst=/fixture-bin,readonly" "$image" >/dev/null image_id=$(docker image inspect -f '{{.Id}}' "$image") -timeout --kill-after=10 240 python3 tests/runtime_export_acceptance.py \ +timeout --kill-after=10 240 python3 tests/acceptance/runtime_export_acceptance.py \ --container "$name" --state "$state" --evidence "$evidence" \ --commit "${GITHUB_SHA:-$(git rev-parse HEAD)}" --image-id "$image_id" test "$(docker inspect -f '{{.State.Running}}' "$name")" = false diff --git a/tests/runtime_export_acceptance.py b/tests/acceptance/runtime_export_acceptance.py similarity index 100% rename from tests/runtime_export_acceptance.py rename to tests/acceptance/runtime_export_acceptance.py diff --git a/tests/runtime_export_diagnostics.py b/tests/acceptance/runtime_export_diagnostics.py similarity index 100% rename from tests/runtime_export_diagnostics.py rename to tests/acceptance/runtime_export_diagnostics.py diff --git a/tests/runtime_export_writer_observer.py b/tests/acceptance/runtime_export_writer_observer.py similarity index 100% rename from tests/runtime_export_writer_observer.py rename to tests/acceptance/runtime_export_writer_observer.py diff --git a/tests/test_browser_ci_diagnostics.py b/tests/acceptance/test_browser_ci_diagnostics.py similarity index 100% rename from tests/test_browser_ci_diagnostics.py rename to tests/acceptance/test_browser_ci_diagnostics.py diff --git a/tests/test_browser_network_ready.py b/tests/acceptance/test_browser_network_ready.py similarity index 100% rename from tests/test_browser_network_ready.py rename to tests/acceptance/test_browser_network_ready.py diff --git a/tests/test_browser_playback_control.py b/tests/acceptance/test_browser_playback_control.py similarity index 97% rename from tests/test_browser_playback_control.py rename to tests/acceptance/test_browser_playback_control.py index 35bf8d0..c0985c4 100644 --- a/tests/test_browser_playback_control.py +++ b/tests/acceptance/test_browser_playback_control.py @@ -10,7 +10,7 @@ from browser_playback_control import template_contract, mark_failed_stages -ROOT = Path(__file__).resolve().parent.parent +ROOT = Path(__file__).resolve().parent.parent.parent class MarkupTests(unittest.TestCase): @@ -45,7 +45,7 @@ def test_failure_marks_only_running_stages(self): class AggregateTests(unittest.IsolatedAsyncioTestCase): def module(self): - spec=importlib.util.spec_from_file_location('browser_expanded_contract',ROOT/'tests/runtime-browser-expanded.py') + spec=importlib.util.spec_from_file_location('browser_expanded_contract',ROOT/'tests/acceptance/runtime-browser-expanded.py') module=importlib.util.module_from_spec(spec);spec.loader.exec_module(module) return module diff --git a/tests/test_browser_playback_edges.py b/tests/acceptance/test_browser_playback_edges.py similarity index 100% rename from tests/test_browser_playback_edges.py rename to tests/acceptance/test_browser_playback_edges.py diff --git a/tests/test_browser_playback_transport.py b/tests/acceptance/test_browser_playback_transport.py similarity index 100% rename from tests/test_browser_playback_transport.py rename to tests/acceptance/test_browser_playback_transport.py diff --git a/tests/test_core_ci_evidence.py b/tests/acceptance/test_core_ci_evidence.py similarity index 99% rename from tests/test_core_ci_evidence.py rename to tests/acceptance/test_core_ci_evidence.py index 6995d12..fcdf496 100644 --- a/tests/test_core_ci_evidence.py +++ b/tests/acceptance/test_core_ci_evidence.py @@ -159,7 +159,7 @@ def test_wrapper_preserves_exit_failure_and_head_mismatch(self): for name,body in programs.items(): path=bindir/name;path.write_text(body);path.chmod(0o700) wrapper=Path(m.__file__).with_name('core-ci-evidence.sh') - checkout=wrapper.parent.parent + checkout=wrapper.parent.parent.parent for mode in ('pass','test_failure','stale_head','tee_failure'): with self.subTest(mode=mode): evidence=self.root/('evidence-'+mode) diff --git a/tests/test_correspondence_assessment.py b/tests/acceptance/test_correspondence_assessment.py similarity index 100% rename from tests/test_correspondence_assessment.py rename to tests/acceptance/test_correspondence_assessment.py diff --git a/tests/test_prepared_export_protocol.py b/tests/acceptance/test_prepared_export_protocol.py similarity index 100% rename from tests/test_prepared_export_protocol.py rename to tests/acceptance/test_prepared_export_protocol.py diff --git a/tests/test_runtime_export_acceptance.py b/tests/acceptance/test_runtime_export_acceptance.py similarity index 100% rename from tests/test_runtime_export_acceptance.py rename to tests/acceptance/test_runtime_export_acceptance.py diff --git a/tests/test_runtime_export_diagnostics.py b/tests/acceptance/test_runtime_export_diagnostics.py similarity index 98% rename from tests/test_runtime_export_diagnostics.py rename to tests/acceptance/test_runtime_export_diagnostics.py index 2b7af20..fa6d73c 100644 --- a/tests/test_runtime_export_diagnostics.py +++ b/tests/acceptance/test_runtime_export_diagnostics.py @@ -109,7 +109,7 @@ def test_exact_exit_trap_preserves_failure_and_cleanup_accounting(self): for name in ("docker","sudo"):(binary/name).chmod(0o700) env=dict(os.environ,PATH=str(binary)+os.pathsep+os.environ["PATH"],DIAGNOSTIC_TEST_RM_FAIL="1" if fail else "0") script='set -euo pipefail\nevidence=$1\nwork=$2\nname=simplenvr-runtime-export-123\n'+cleanup+'trap cleanup EXIT\nexit "$3"\n' - result=subprocess.run(["bash","-c",script,"test",str(evidence),str(root),str(code)],cwd=path.parent.parent,env=env,capture_output=True,text=True,timeout=5) + result=subprocess.run(["bash","-c",script,"test",str(evidence),str(root),str(code)],cwd=path.parent.parent.parent,env=env,capture_output=True,text=True,timeout=5) self.assertEqual(result.returncode,1 if fail else code) self.assertIn('"diagnostic_only": true',result.stdout) self.assertEqual((evidence/"runtime-export-report.json").read_text(),raw) diff --git a/tests/test_runtime_export_observer_exit.py b/tests/acceptance/test_runtime_export_observer_exit.py similarity index 100% rename from tests/test_runtime_export_observer_exit.py rename to tests/acceptance/test_runtime_export_observer_exit.py diff --git a/tests/test_runtime_export_writer_observer.py b/tests/acceptance/test_runtime_export_writer_observer.py similarity index 100% rename from tests/test_runtime_export_writer_observer.py rename to tests/acceptance/test_runtime_export_writer_observer.py diff --git a/tests/camera-removal-confirmation.cjs b/tests/frontend/camera-removal-confirmation.cjs similarity index 100% rename from tests/camera-removal-confirmation.cjs rename to tests/frontend/camera-removal-confirmation.cjs diff --git a/tests/download-entrypoints.cjs b/tests/frontend/download-entrypoints.cjs similarity index 100% rename from tests/download-entrypoints.cjs rename to tests/frontend/download-entrypoints.cjs diff --git a/tests/event-clear-confirmation.cjs b/tests/frontend/event-clear-confirmation.cjs similarity index 100% rename from tests/event-clear-confirmation.cjs rename to tests/frontend/event-clear-confirmation.cjs diff --git a/tests/event-navigation.cjs b/tests/frontend/event-navigation.cjs similarity index 100% rename from tests/event-navigation.cjs rename to tests/frontend/event-navigation.cjs diff --git a/tests/event-rendering.cjs b/tests/frontend/event-rendering.cjs similarity index 100% rename from tests/event-rendering.cjs rename to tests/frontend/event-rendering.cjs diff --git a/tests/export-mode-ui.cjs b/tests/frontend/export-mode-ui.cjs similarity index 100% rename from tests/export-mode-ui.cjs rename to tests/frontend/export-mode-ui.cjs diff --git a/tests/export-queue-details.cjs b/tests/frontend/export-queue-details.cjs similarity index 100% rename from tests/export-queue-details.cjs rename to tests/frontend/export-queue-details.cjs diff --git a/tests/export-range-controls.cjs b/tests/frontend/export-range-controls.cjs similarity index 100% rename from tests/export-range-controls.cjs rename to tests/frontend/export-range-controls.cjs diff --git a/tests/export-ui-fixture.cjs b/tests/frontend/export-ui-fixture.cjs similarity index 99% rename from tests/export-ui-fixture.cjs rename to tests/frontend/export-ui-fixture.cjs index d7f7472..e042917 100644 --- a/tests/export-ui-fixture.cjs +++ b/tests/frontend/export-ui-fixture.cjs @@ -3,7 +3,7 @@ // DOMContentLoaded callbacks, and models the pointer and keyboard APIs used by handles. // HTML sinks and inline handlers throw so any HTML injection path fails the tests. const fs = require('node:fs'), vm = require('node:vm'), path = require('node:path'); -const root = path.join(__dirname, '..'); +const root = path.join(__dirname, '..', '..'); const source = fs.readFileSync(path.join(root, 'static/js/export-ui.js'), 'utf8'); const geometrySource = fs.readFileSync(path.join(root, 'static/js/timeline-geometry.js'), 'utf8'); const VIEW_START = Date.parse('2026-11-21T00:00:00Z'), VIEW_END = Date.parse('2026-11-22T00:00:00Z'); diff --git a/tests/export-ui.cjs b/tests/frontend/export-ui.cjs similarity index 99% rename from tests/export-ui.cjs rename to tests/frontend/export-ui.cjs index 8e22ec8..4e6a8a2 100644 --- a/tests/export-ui.cjs +++ b/tests/frontend/export-ui.cjs @@ -1,7 +1,7 @@ const assert = require('node:assert/strict'); const fs = require('node:fs'), path = require('node:path'); const {environment, letterId, view, response} = require('./export-ui-fixture.cjs'); -const source = fs.readFileSync(path.join(__dirname, '../static/js/export-ui.js'), 'utf8'); +const source = fs.readFileSync(path.join(__dirname, '../../static/js/export-ui.js'), 'utf8'); // Static security policy: no video buffering, no HTML sinks, no legacy approval flow. for (const banned of ['new Blob(', 'createObjectURL', '.blob()', 'arrayBuffer(', 'innerHTML', 'outerHTML', 'insertAdjacentHTML', 'document.write', diff --git a/tests/live-stream-names.cjs b/tests/frontend/live-stream-names.cjs similarity index 100% rename from tests/live-stream-names.cjs rename to tests/frontend/live-stream-names.cjs diff --git a/tests/orphan-cleanup-reporting.cjs b/tests/frontend/orphan-cleanup-reporting.cjs similarity index 100% rename from tests/orphan-cleanup-reporting.cjs rename to tests/frontend/orphan-cleanup-reporting.cjs diff --git a/tests/persistence-responses.cjs b/tests/frontend/persistence-responses.cjs similarity index 98% rename from tests/persistence-responses.cjs rename to tests/frontend/persistence-responses.cjs index 4ed779a..aa5947b 100644 --- a/tests/persistence-responses.cjs +++ b/tests/frontend/persistence-responses.cjs @@ -5,7 +5,7 @@ const vm = require('node:vm'); const sources = ['cameras.js', 'modals.js'].map(name => ({ name, - text: fs.readFileSync(path.join(__dirname, '..', 'static', 'js', name), 'utf8') + text: fs.readFileSync(path.join(__dirname, '..', '..', 'static', 'js', name), 'utf8') })); const html = '