- tests/custom-html/PARITY.md: parity mapping (health_check.py ported); recipe-specific tests recorded with rationale; backup data-integrity + playwright sections. - tests/custom-html/functional/test_health_check.py: parity port of recipe-info/custom-html/tests/health_check.py — SOURCE comment included. - tests/custom-html/functional/test_content_roundtrip.py: NEW recipe-specific — write a marker into the served volume, fetch over HTTPS, assert exact bytes. - tests/custom-html/functional/test_content_type_header.py: NEW recipe-specific — prove nginx returns text/html for .html and text/plain for .txt (MIME mapping). - tests/custom-html/playwright/test_browser_smoke.py: P6 browser smoke (renders HTML, no console errors). Standalone Phase-2 custom-stage version. Verified cold on cc-ci (STAGES=install,custom): 5 assertions all PASS in one run (install generic + install overlay + content roundtrip + content type + health check + browser smoke), deploy-count=1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
44 lines
3.1 KiB
Markdown
44 lines
3.1 KiB
Markdown
# Parity — custom-html
|
|
|
|
Phase-2 P2 mapping table: every `references/recipe-maintainer/recipe-info/custom-html/tests/*.py` has
|
|
a comparable cc-ci test under `tests/custom-html/functional/`, asserting the **same thing** (not just
|
|
a renamed file). The Adversary cold-verifies parity by reading the source `recipe-info/<file>` and the
|
|
cc-ci file side-by-side.
|
|
|
|
| recipe-maintainer file | cc-ci file | what's verified | status |
|
|
|---|---|---|---|
|
|
| `recipe-info/custom-html/tests/health_check.py` | `tests/custom-html/functional/test_health_check.py` | The app is reachable over HTTPS and returns a successful response (the original asserted HTTP 200 against a persistent instance). The cc-ci port preserves the assertion shape — non-5xx status — and adapts to the ephemeral per-run domain via the `live_app` fixture. | **ported** |
|
|
|
|
## Recipe-specific tests (Phase-2 P3, ≥2 beyond parity)
|
|
|
|
custom-html is an nginx serving the `/usr/share/nginx/html` volume — its characteristic behavior is
|
|
**serving / persisting static content** (see plan §4.3 "custom-html — serve/persist content: write
|
|
content, fetch it back"). Two new functional tests beyond parity:
|
|
|
|
| cc-ci file | what's verified | rationale |
|
|
|---|---|---|
|
|
| `tests/custom-html/functional/test_content_roundtrip.py` | Writes a uniquely-marked content file to the served volume via `lifecycle.exec_in_app` and asserts an HTTPS GET to the corresponding path returns that exact byte content — proves the app serves files written into its served volume, not a static synthetic page. | The recipe IS a content-server: a roundtrip is the canonical proof it works for what it's for. |
|
|
| `tests/custom-html/functional/test_content_type_header.py` | Writes both an `.html` and a `.txt` marker to the served volume, fetches each, and asserts `Content-Type` reflects the file type (`text/html`, `text/plain`) — proves nginx is properly serving with MIME-typed responses, not just returning bytes. | Distinctive nginx-served behavior — distinguishes a working nginx from a misconfigured one that emits everything as `application/octet-stream`. |
|
|
|
|
Both tests run in the **custom** stage against the same `live_app` shared deployment as the
|
|
lifecycle overlays — no extra deploy, no extra teardown.
|
|
|
|
## Backup data-integrity (P4)
|
|
|
|
Already exercised by the lifecycle overlays from Phase 1d/1e:
|
|
`tests/custom-html/test_backup.py` + `test_restore.py` + `ops.py` (`pre_backup` seeds `original`,
|
|
`pre_restore` mutates to `mutated`; restore must return the volume to `original`). The marker is read
|
|
via `lifecycle.exec_in_app` (volume-direct, immune to the post-backup serving race).
|
|
|
|
## Playwright (P6)
|
|
|
|
`tests/custom-html/playwright/test_browser_smoke.py` covers the browser-rendered nginx HTML — already
|
|
exercised inline by `tests/custom-html/test_install.py::test_serving_and_content` (lifecycle install
|
|
overlay), which uses Playwright Chromium to confirm the page renders. The Phase-2 split file is the
|
|
canonical home for browser-flow coverage and is invoked by the **custom** stage.
|
|
|
|
## Non-ports
|
|
|
|
None — the recipe-maintainer custom-html `tests/` directory contains only `health_check.py`, which
|
|
is fully ported above.
|