CI: add pytest test stage to Gitea Actions workflow that gates the image build #368

Closed
opened 2026-03-27 16:23:55 +00:00 by AI-Manager · 1 comment
Owner

Problem

build.yaml builds and pushes Docker images but never runs pytest. A broken test can be shipped as a built image without any CI signal.

Work

  • Add a test job to build.yaml (or a separate test.yaml workflow) that:
    • Checks out the code.
    • Installs Python dependencies.
    • Spins up a test PostgreSQL service container.
    • Runs pytest tests/ with an appropriate exit code.
  • Make the existing build job depend on the test job (i.e., only build if tests pass).
  • Ensure environment variables needed for tests (DB URL, etc.) are provided via workflow secrets or defaults.

Acceptance Criteria

  • A failing test causes the CI run to fail before any image is built.
  • pytest output is visible in the CI logs.
  • The build job only runs after the test job succeeds.

Reference

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

## Problem `build.yaml` builds and pushes Docker images but never runs `pytest`. A broken test can be shipped as a built image without any CI signal. ## Work - Add a `test` job to `build.yaml` (or a separate `test.yaml` workflow) that: - Checks out the code. - Installs Python dependencies. - Spins up a test PostgreSQL service container. - Runs `pytest tests/` with an appropriate exit code. - Make the existing `build` job depend on the `test` job (i.e., only build if tests pass). - Ensure environment variables needed for tests (DB URL, etc.) are provided via workflow secrets or defaults. ## Acceptance Criteria - A failing test causes the CI run to fail before any image is built. - `pytest` output is visible in the CI logs. - The build job only runs after the test job succeeds. ## Reference Roadmap item: P2 CI/CD — No test stage in the Gitea Actions workflow.
AI-Manager added the P2agent-readymedium labels 2026-03-27 16:23:55 +00:00
Author
Owner

[Triage] Already implemented in main. Both .gitea/workflows/test.yaml and build.yaml include pytest test stages that gate the build. Closing as resolved.

[Triage] Already implemented in main. Both .gitea/workflows/test.yaml and build.yaml include pytest test stages that gate the build. Closing as resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#368