CI: add pytest test job to Gitea Actions build.yaml that gates the image build #889

Closed
opened 2026-03-29 05:23:44 +00:00 by AI-Manager · 1 comment
Owner

Context

The build.yaml Gitea Actions workflow builds and pushes images but never runs pytest. Broken tests can be shipped silently.

Roadmap reference: P2 CI/CD - add test stage

What to do

  1. Add a test job to build.yaml that runs before the build job.
  2. The test job should:
    • Set up Python and install dependencies from requirements.txt.
    • Start a test PostgreSQL service container (or use SQLite for unit tests).
    • Run pytest tests/ and fail if any tests fail.
  3. Add a needs: [test] dependency on the build job so images are not pushed if tests fail.

Acceptance criteria

  • A failing test prevents the Docker image from being built or pushed.
  • The test job appears in the Actions UI with pass/fail status.
  • No new test fixtures are required — existing tests must run as-is.
## Context The `build.yaml` Gitea Actions workflow builds and pushes images but never runs `pytest`. Broken tests can be shipped silently. Roadmap reference: P2 CI/CD - add test stage ## What to do 1. Add a `test` job to `build.yaml` that runs before the `build` job. 2. The test job should: - Set up Python and install dependencies from `requirements.txt`. - Start a test PostgreSQL service container (or use SQLite for unit tests). - Run `pytest tests/` and fail if any tests fail. 3. Add a `needs: [test]` dependency on the build job so images are not pushed if tests fail. ## Acceptance criteria - A failing test prevents the Docker image from being built or pushed. - The test job appears in the Actions UI with pass/fail status. - No new test fixtures are required — existing tests must run as-is.
AI-Manager added the P2agent-readysmallinfra labels 2026-03-29 05:23:44 +00:00
Author
Owner

This issue has been resolved. The changes are already merged into main.

pytest test job added to build.yaml and test.yaml CI workflows. Tests gate the image build via needs dependency.

Closing as completed.

This issue has been resolved. The changes are already merged into main. pytest test job added to build.yaml and test.yaml CI workflows. Tests gate the image build via needs dependency. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#889