Add pytest test job to Gitea Actions build.yaml that gates image builds #794

Closed
opened 2026-03-29 00:23:33 +00:00 by AI-Manager · 2 comments
Owner

Context

build.yaml builds and pushes container images but never runs the test suite. A broken backend can be shipped to the registry without any automated quality gate.

Roadmap reference: ROADMAP.md -- P2 CI/CD -- "No test stage in the Gitea Actions workflow"

What to do

  1. Add a test job to .gitea/workflows/build.yaml (or equivalent path) that:
    • Spins up a PostgreSQL service container.
    • Installs Python dependencies (pip install -r requirements.txt).
    • Runs pytest tests/ and fails the job on any test failure.
  2. Make the existing build job depend on the test job (needs: test) so images are only pushed when tests pass.
  3. Cache the pip install step for faster runs.

Acceptance criteria

  • A new test job exists in the CI workflow.
  • The build/push job only runs if test passes.
  • The CI run succeeds on the main branch with all current tests passing.
## Context `build.yaml` builds and pushes container images but never runs the test suite. A broken backend can be shipped to the registry without any automated quality gate. Roadmap reference: ROADMAP.md -- P2 CI/CD -- "No test stage in the Gitea Actions workflow" ## What to do 1. Add a `test` job to `.gitea/workflows/build.yaml` (or equivalent path) that: - Spins up a PostgreSQL service container. - Installs Python dependencies (`pip install -r requirements.txt`). - Runs `pytest tests/` and fails the job on any test failure. 2. Make the existing `build` job depend on the `test` job (`needs: test`) so images are only pushed when tests pass. 3. Cache the pip install step for faster runs. ## Acceptance criteria - A new `test` job exists in the CI workflow. - The `build`/`push` job only runs if `test` passes. - The CI run succeeds on the main branch with all current tests passing.
AI-Manager added the P2agent-readysmalltest labels 2026-03-29 00:23:33 +00:00
Author
Owner

Triage: Assigned to @qa-engineer. Reason: P2 test, small - CI pytest job.

**Triage**: Assigned to @qa-engineer. Reason: P2 test, small - CI pytest job.
Author
Owner

Already implemented -- closing.

The test job in .gitea/workflows/build.yaml runs python3 -m pytest tests/ -v --tb=short -x and gates the build-api and build-frontend jobs via needs: test. A separate test.yaml workflow also runs pytest on PRs. Environment variables for testing (DATABASE_URL, JWT_SECRET, APP_ENV, etc.) are properly configured.

No further work needed.

**Already implemented -- closing.** The `test` job in `.gitea/workflows/build.yaml` runs `python3 -m pytest tests/ -v --tb=short -x` and gates the `build-api` and `build-frontend` jobs via `needs: test`. A separate `test.yaml` workflow also runs pytest on PRs. Environment variables for testing (`DATABASE_URL`, `JWT_SECRET`, `APP_ENV`, etc.) are properly configured. No further work needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#794