diff --git a/scripts/docker-runtime-smoke.sh b/scripts/docker-runtime-smoke.sh index ad20b5c..c2c6b85 100644 --- a/scripts/docker-runtime-smoke.sh +++ b/scripts/docker-runtime-smoke.sh @@ -18,7 +18,9 @@ cleanup() { docker logs "$CONTAINER_NAME" >/dev/null 2>&1 || true docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true if [[ -z "${VOXVERA_DOCKER_SMOKE_TMPDIR:-}" ]]; then - rm -rf "$TMP_DIR" + chmod -R u+w "$TMP_DIR" 2>/dev/null || true + docker run --rm -v "$TMP_DIR:/cleanup" python:3.11-slim sh -lc 'rm -rf /cleanup/* /cleanup/.[!.]* /cleanup/..?* 2>/dev/null || true' >/dev/null 2>&1 || true + rm -rf "$TMP_DIR" 2>/dev/null || true fi } trap cleanup EXIT diff --git a/tests/test_integrity.py b/tests/test_integrity.py index 7e786d1..27aeabd 100644 --- a/tests/test_integrity.py +++ b/tests/test_integrity.py @@ -97,6 +97,14 @@ def test_docker_runtime_assets_are_present(): assert "scripts/docker-runtime-smoke.sh" in ci_workflow assert "starts an in-container Tor daemon" in docker_doc + +def test_support_matrix_path_has_runtime_fallbacks(): + base_platform = (REPO_ROOT / "voxvera" / "platforms" / "base.py").read_text(encoding="utf-8") + + assert "VOXVERA_SUPPORT_MATRIX_PATH" in base_platform + assert 'Path.cwd() / "support-matrix.json"' in base_platform + assert 'Path("/opt/voxvera/support-matrix.json")' in base_platform + def test_locale_completeness(): """Verify that all non-English locales have the same keys as English.""" locales_dir = REPO_ROOT / "voxvera" / "locales" diff --git a/voxvera/platforms/base.py b/voxvera/platforms/base.py index c49b389..80772fd 100644 --- a/voxvera/platforms/base.py +++ b/voxvera/platforms/base.py @@ -1,6 +1,7 @@ from __future__ import annotations import json +import os import platform import shutil import subprocess @@ -33,6 +34,20 @@ class PlatformAdapter: @property def support_matrix_path(self) -> Path: + candidates = [] + env_path = os.environ.get("VOXVERA_SUPPORT_MATRIX_PATH") + if env_path: + candidates.append(Path(env_path)) + candidates.extend( + [ + self.repo_root / "support-matrix.json", + Path.cwd() / "support-matrix.json", + Path("/opt/voxvera/support-matrix.json"), + ] + ) + for candidate in candidates: + if candidate.exists(): + return candidate return self.repo_root / "support-matrix.json" def _run_capture(self, args: list[str]) -> tuple[bool, str]: