feat(regression): add E2E canary regression suite (tests/regression/)
continuous-integration/drone/push Build is failing
continuous-integration/drone/push Build is failing
Seven canaries prove both halves of the server's job: - GREEN: good apps are reported healthy (good-simple + good-significant) - RED: broken apps are caught at intended tier (false-green guard + 4 per-tier) Fixtures: custom-html-bkp-bad (backup tier RED) + custom-html-rst-bad (restore tier RED). All 7 canaries verified on live server (see STATUS-regression.md for artifacts). Not wired to per-commit CI — run on-demand: pytest -m canary tests/regression/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
baf5a21bdc
commit
73427d6e36
@@ -0,0 +1,15 @@
|
||||
"""custom-html-rst-bad — lifecycle ops for bad-restore RED canary.
|
||||
|
||||
NO pre_backup hook: marker never seeded before backup → snapshot has no ci-marker.txt.
|
||||
pre_restore writes "mutated". After restore, marker stays "mutated" (not in snapshot) → FAIL.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from harness import lifecycle
|
||||
|
||||
MARKER_PATH = "/usr/share/nginx/html/ci-marker.txt"
|
||||
|
||||
|
||||
def pre_restore(domain: str, meta: dict) -> None:
|
||||
lifecycle.exec_in_app(domain, ["sh", "-c", f"echo mutated > {MARKER_PATH}"])
|
||||
@@ -0,0 +1,3 @@
|
||||
# custom-html-rst-bad — regression fixture for bad-restore canary.
|
||||
# BACKUP_CAPABLE=True forces the backup tier to run even though the recipe has no backupbot label.
|
||||
BACKUP_CAPABLE = True
|
||||
@@ -0,0 +1,23 @@
|
||||
"""custom-html-rst-bad — RESTORE assertion (bad-restore RED canary).
|
||||
|
||||
No pre_backup → backup snapshot has no ci-marker.txt. pre_restore writes "mutated".
|
||||
After restore: marker is "mutated" (restore can't recover "original" — wasn't backed up) → FAIL.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "runner"))
|
||||
from harness import lifecycle # noqa: E402
|
||||
|
||||
MARKER_PATH = "/usr/share/nginx/html/ci-marker.txt"
|
||||
|
||||
|
||||
def test_restore_returns_state(live_app):
|
||||
result = lifecycle.exec_in_app(
|
||||
live_app, ["sh", "-c", f"cat {MARKER_PATH} 2>/dev/null || echo MISSING"]
|
||||
).strip()
|
||||
assert result == "original", (
|
||||
f"restore did not return the pre-mutation (backed-up) state: got {result!r}. "
|
||||
"Expected 'original'. The backup had no marker, so restore cannot recover it."
|
||||
)
|
||||
Reference in New Issue
Block a user