diff --git a/app.py b/app.py index 080259c..51b6941 100644 --- a/app.py +++ b/app.py @@ -1124,7 +1124,7 @@ os.chmod(env, 0o600) if rc != 0: _ssh(VPS_SSH, rollback, timeout=180) raise RuntimeError(f"StreamScope build preflight failed: {err[-500:]}") - deploy = "cd /app-config/github/speedtest && (docker rm -f speedtest >/dev/null 2>&1 || true) && docker compose up -d --remove-orphans" + deploy = "cd /app-config/github/speedtest && docker compose up -d --remove-orphans" rc, out, err = _ssh(VPS_SSH, deploy, timeout=180) if rc != 0: _ssh(VPS_SSH, rollback, timeout=180) diff --git a/tests/test_streamscope_deploy.py b/tests/test_streamscope_deploy.py deleted file mode 100644 index 65bd7b0..0000000 --- a/tests/test_streamscope_deploy.py +++ /dev/null @@ -1,37 +0,0 @@ -import app - - -def test_streamscope_deploy_replaces_legacy_container_before_compose(monkeypatch): - files = {path: "placeholder" for path in app.SPEEDTEST_REPO_FILES} - files["compose.yaml"] = """services: - streamscope: - build: . - ports: - - '127.0.0.1:8080:8080' - environment: - ADMIN_PASSWORD: "${ADMIN_PASSWORD:?required}" - SESSION_SECRET: "${SESSION_SECRET:?required}" - volumes: - - /app-config/speedtest/data:/data - cap_add: - - NET_RAW -""" - files["Dockerfile"] = "FROM python:3.13-slim\nRUN apt-get install -y mtr-tiny\n" - commands = [] - - monkeypatch.setattr(app, "_remote_python", lambda script: (0, "", "")) - - def fake_ssh(host, command, timeout=600): - commands.append(command) - return 0, "ok", "" - - monkeypatch.setattr(app, "_ssh", fake_ssh) - result = app._deploy_speedtest_compose( - files, - "correct-horse-battery-staple", - "streamscope-session-secret-with-entropy", - ) - - deploy = next(command for command in commands if "compose up -d --remove-orphans" in command) - assert "docker rm -f speedtest" in deploy - assert result["application"] == "streamscope"