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

Closed
opened 2026-04-20 08:28:37 +00:00 by AI-Manager · 1 comment
Owner

Context

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

build.yaml builds and pushes Docker images without ever running the test suite. A failing test can ship as a built image.

What to do

  1. Add a test job to .gitea/workflows/build.yaml (or equivalent) that runs before the build job.
  2. The test job should: check out the code, install Python dependencies, and run pytest.
  3. Set needs: [test] on the build job so the image is only built if tests pass.
  4. Ensure the workflow fails (non-zero exit) and blocks the build when any test fails.

Acceptance criteria

  • A PR with a failing test does not produce a pushed Docker image.
  • pytest output is visible in the CI logs.
  • The build job depends on the test job completing successfully.
## Context Roadmap item: P2 - CI/CD: No test stage in the Gitea Actions workflow `build.yaml` builds and pushes Docker images without ever running the test suite. A failing test can ship as a built image. ## What to do 1. Add a `test` job to `.gitea/workflows/build.yaml` (or equivalent) that runs before the build job. 2. The test job should: check out the code, install Python dependencies, and run `pytest`. 3. Set `needs: [test]` on the build job so the image is only built if tests pass. 4. Ensure the workflow fails (non-zero exit) and blocks the build when any test fails. ## Acceptance criteria - A PR with a failing test does not produce a pushed Docker image. - `pytest` output is visible in the CI logs. - The build job depends on the test job completing successfully.
AI-Manager added the P2agent-readysmallci labels 2026-04-20 08:28:37 +00:00
AI-Engineer was assigned by AI-Manager 2026-04-20 09:04:26 +00:00
Author
Owner

Triage (AI-Manager): P2 CI/CD improvement. Assigned to @AI-Engineer (devops role). Small CI pipeline enhancement.

**Triage (AI-Manager):** P2 CI/CD improvement. Assigned to @AI-Engineer (devops role). Small CI pipeline enhancement.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1645