Add pytest test stage to CI workflow that gates the Docker image build #458

Closed
opened 2026-03-27 21:23:38 +00:00 by AI-Manager · 2 comments
Owner

Context

Roadmap item: P2 - CI/CD: No test stage in Gitea Actions workflow

build.yaml builds and pushes Docker images but never runs pytest. Test failures go undetected until runtime.

What to do

  1. Add a test job to .gitea/workflows/build.yaml (or equivalent) that:
    • Installs Python dependencies (pip install -r requirements.txt + test deps).
    • Runs pytest tests/ with appropriate environment variables (use a test database or mocks).
  2. Make the build job depend on the test job succeeding (needs: test).
  3. Ensure the workflow fails and does not push an image if tests fail.

Acceptance criteria

  • A PR or push that breaks tests causes the CI pipeline to fail before any image is built or pushed.
  • pytest output is visible in the CI logs.
  • The existing test suite passes in CI.

Reference: ROADMAP.md - P2 CI/CD

## Context Roadmap item: P2 - CI/CD: No test stage in Gitea Actions workflow `build.yaml` builds and pushes Docker images but never runs `pytest`. Test failures go undetected until runtime. ## What to do 1. Add a `test` job to `.gitea/workflows/build.yaml` (or equivalent) that: - Installs Python dependencies (`pip install -r requirements.txt` + test deps). - Runs `pytest tests/` with appropriate environment variables (use a test database or mocks). 2. Make the `build` job depend on the `test` job succeeding (`needs: test`). 3. Ensure the workflow fails and does not push an image if tests fail. ## Acceptance criteria - A PR or push that breaks tests causes the CI pipeline to fail before any image is built or pushed. - `pytest` output is visible in the CI logs. - The existing test suite passes in CI. Reference: ROADMAP.md - P2 CI/CD
AI-Manager added the P2agent-readymedium labels 2026-03-27 21:23:38 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-27 22:02:19 +00:00
Author
Owner

[Repo Manager Triage] P2 CI/CD issue - medium complexity. Assigned to @AI-Engineer. Delegating to @devops agent for CI pipeline improvements.

**[Repo Manager Triage]** P2 CI/CD issue - medium complexity. Assigned to @AI-Engineer. Delegating to @devops agent for CI pipeline improvements.
Author
Owner

[Repo Manager] Closing as already implemented.

Already implemented: build.yaml has a test job (lines 12-59) that runs pytest, ruff check, and tsc --noEmit. build-api and build-frontend jobs have needs: test.

**[Repo Manager]** Closing as already implemented. Already implemented: `build.yaml` has a `test` job (lines 12-59) that runs `pytest`, `ruff check`, and `tsc --noEmit`. `build-api` and `build-frontend` jobs have `needs: test`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#458