ci(docker): stop re-running unit tests inside the test image

The "Docker Build" job in ci.yml was running the same 5287 backend
  tests + 2022 frontend tests inside the bambuddy-backend-test /
  bambuddy-frontend-test images that the host-side backend-tests and
  frontend-tests jobs had already run. Same test code, same Python
  version (env.PYTHON_VERSION), same requirements.txt the test image
  installs. On 2-vCPU GHA runners that re-run added 5-10 min of
  wall-clock for zero new coverage — and "frontend tests in Docker"
  added another 2-3 min for the same reason.

  Drop both steps from the CI job. Keep everything that validates the
  Docker IMAGE specifically: production image build, backend module
  import verification, static-files-copied check, integration
  container bring-up + health/API/static HTTP smoke checks, and the
  integration test suite (which IS genuinely Docker-specific — it
  runs against the live container via BAMBUDDY_TEST_URL).

  test_docker.sh keeps the unit-test reruns because devs running it
  locally don't have a separate host-side pytest job to compare
  against.

  Combined with the earlier 4-way pytest-split shard on the host
  backend-tests job, expected PR-push wall-clock drops from
  ~10-12 min to ~3 min, gated on max(backend-tests shard, frontend
  tests, docker-image-build+integration).
This commit is contained in:
maziggy 2026-05-24 13:19:55 +02:00
parent e377b4aaa9
commit 1b271a8ead

View file

@ -298,19 +298,18 @@ jobs:
- name: Verify static files exist
run: docker run --rm bambuddy:test test -d /app/static
# Test 2: Backend Unit Tests in Docker
- name: Build backend test image
run: docker compose -f docker-compose.test.yml build backend-test
- name: Run backend tests in Docker
run: docker compose -f docker-compose.test.yml run --rm backend-test
# Test 3: Frontend Unit Tests in Docker
- name: Build frontend test image
run: docker compose -f docker-compose.test.yml build frontend-test
- name: Run frontend tests in Docker
run: docker compose -f docker-compose.test.yml run --rm frontend-test
# NOTE: Tests 2 and 3 from test_docker.sh (backend / frontend unit
# tests inside the test image) used to run here. They've been removed
# from the CI pipeline because the host-side `backend-tests` and
# `frontend-tests` jobs already exercise the exact same test code
# against the exact same Python version + requirements.txt the test
# image installs — on 2-vCPU GHA runners a re-run inside Docker
# added 5-10 min of wall-clock for zero new coverage. The
# image-validation purpose of this job (does it build, do imports
# resolve, does the integration container come up and answer HTTP)
# lives in the surrounding steps. test_docker.sh keeps the unit-test
# runs because devs running it locally don't have a separate host-
# side pytest job to compare against.
# Test 4: Integration Tests
- name: Build integration container