Release v0.1.9: enforce Photos API boundary and finalize Server migration
This commit is contained in:
@@ -164,21 +164,14 @@ def test_activate_escapes_dollar_secrets_and_never_down(tool, monkeypatch):
|
||||
assert len(calls) == 2 and "up" in calls[1] and "--no-build" in calls[1]
|
||||
|
||||
|
||||
def test_workflow_deploy_is_verify_gated_and_manual_plan_default(tool):
|
||||
def test_workflow_verifies_without_legacy_production_deploy(tool):
|
||||
import yaml
|
||||
|
||||
workflow = yaml.safe_load(
|
||||
(Path(__file__).parents[1] / ".github/workflows/verify.yml").read_text()
|
||||
)
|
||||
job = workflow["jobs"]["deploy"]
|
||||
assert job["needs"] == "verify" and "success()" in job["if"]
|
||||
assert "refs/heads/main" in job["if"] and "pull_request" not in job["if"]
|
||||
assert job["env"]["PROD_DEPLOY_ENABLED"] == "${{ vars.PROD_DEPLOY_ENABLED }}"
|
||||
assert (
|
||||
workflow[True]["workflow_dispatch"]["inputs"]["deploy_action"]["default"]
|
||||
== "plan"
|
||||
)
|
||||
assert job["steps"][-1]["if"] == "always()"
|
||||
assert set(workflow["jobs"]) == {"verify"}
|
||||
assert workflow[True]["workflow_dispatch"] is None
|
||||
|
||||
|
||||
def test_recovery_handles_missing_or_crashed_production_container(tool, monkeypatch):
|
||||
@@ -311,3 +304,24 @@ def test_image_retention_failure_does_not_fail_verified_deploy(
|
||||
output = capsys.readouterr().out
|
||||
assert "cleanup deferred" in output
|
||||
assert "private diagnostic" not in output
|
||||
|
||||
|
||||
def test_retired_nas_target_is_rejected(tool):
|
||||
tool.env["PROD_DATA_DIR"] = "/volume2/docker/pigway-frame-flow/data"
|
||||
with pytest.raises(ValueError, match="retired"):
|
||||
tool.settings()
|
||||
|
||||
|
||||
def test_preflight_rejects_legacy_photo_mount(tool, monkeypatch):
|
||||
old = existing(tool)
|
||||
old["Mounts"].append(
|
||||
{
|
||||
"Type": "bind",
|
||||
"Source": "/volume1/photo",
|
||||
"Destination": "/photos",
|
||||
"RW": False,
|
||||
}
|
||||
)
|
||||
monkeypatch.setattr(tool, "inspect", lambda _: old)
|
||||
with pytest.raises(ValueError, match="retired"):
|
||||
tool.preflight()
|
||||
|
||||
Reference in New Issue
Block a user