From 07ea69c3f0fc405ac6ea7d9a96cb67fe4b444abe Mon Sep 17 00:00:00 2001 From: maziggy Date: Sun, 24 May 2026 11:26:14 +0200 Subject: [PATCH] test(docker): include gcode_viewer/ in the test image so the packaging assertion actually runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dockerfile.test only COPYed backend/ and pyproject.toml, so the integration test at tests/integration/test_gcode_viewer.py:63 silently pytest.skip'd in every Docker run with "gcode_viewer/ index.html not present at /app/gcode_viewer/index.html". That was deliberate fallback behaviour for unit-test environments where the assets are intentionally absent, but in CI it meant the #1218 packaging regression (3D Preview returning {"detail":"Not Found"} because the embedded PrettyGCode viewer wasn't bundled into the prod image) had no test guarding against a recurrence — the test that was supposed to catch it was the one being skipped. Add COPY gcode_viewer/ ./gcode_viewer/ to the backend-test stage, matching the path the production Dockerfile uses (static_dir.parent / "gcode_viewer" = /app/gcode_viewer/) so the assertion runs against the same layout the app sees at runtime. Path-anchored comment in the Dockerfile so a future maintainer doesn't strip the COPY as unused. --- Dockerfile.test | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile.test b/Dockerfile.test index 9a33b0731..4a77a00db 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -17,6 +17,12 @@ RUN pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt COPY backend/ ./backend/ COPY pyproject.toml ./ +# Embedded GCode viewer assets — required so the @app.get("/gcode-viewer/...") +# packaging-regression test in tests/integration/test_gcode_viewer.py actually +# runs instead of pytest-skipping with "index.html not present". Path matches +# the production Dockerfile (static_dir.parent / "gcode_viewer" = /app/gcode_viewer/). +COPY gcode_viewer/ ./gcode_viewer/ + # Create necessary directories RUN mkdir -p /app/data /app/logs /app/archive