diff --git a/backend/tests/unit/test_launcher_shutdown_config.py b/backend/tests/unit/test_launcher_shutdown_config.py index 9ec479b24..54363f067 100644 --- a/backend/tests/unit/test_launcher_shutdown_config.py +++ b/backend/tests/unit/test_launcher_shutdown_config.py @@ -34,6 +34,19 @@ REPO = Path(__file__).resolve().parents[3] FLAG = "--timeout-graceful-shutdown" +# These pin repo-root launcher files (Dockerfile, compose, service units, +# install scripts) that the Docker test image deliberately does not ship — +# Dockerfile.test copies only backend/, pyproject.toml, gcode_viewer/ and +# requirements. In a source checkout the files are always present and the +# guard below is live (a moved/deleted launcher still fails loudly on every +# `test_backend.sh` run); inside the stripped test image there is nothing to +# check, so skip rather than fail. `frontend/package.json` is present in every +# checkout but never in the test image, so it distinguishes the two. +pytestmark = pytest.mark.skipif( + not (REPO / "frontend" / "package.json").is_file(), + reason="launcher config files aren't shipped in the Docker test image; verified in native runs", +) + def _read(rel: str) -> str: path = REPO / rel diff --git a/backend/tests/unit/test_systemd_backup_paths.py b/backend/tests/unit/test_systemd_backup_paths.py index 4c2a8ddb8..40cf64c31 100644 --- a/backend/tests/unit/test_systemd_backup_paths.py +++ b/backend/tests/unit/test_systemd_backup_paths.py @@ -20,6 +20,17 @@ REPO = Path(__file__).resolve().parents[3] INSTALLERS = ["install/install.sh", "spoolbuddy/install/install.sh"] +# The service unit + install scripts these tests read live at the repo root and +# are not copied into the Docker test image (Dockerfile.test ships only backend/, +# pyproject.toml, gcode_viewer/ and requirements). In a source checkout they are +# always present and the guard below is live; in the stripped test image there is +# nothing to check, so skip rather than fail. `frontend/package.json` exists in +# every checkout but never in the test image, so it distinguishes the two. +pytestmark = pytest.mark.skipif( + not (REPO / "frontend" / "package.json").is_file(), + reason="launcher config files aren't shipped in the Docker test image; verified in native runs", +) + def _read(rel: str) -> str: path = REPO / rel