Add pytest test job to Gitea Actions CI workflow that gates image build #1279

Closed
opened 2026-03-30 09:24:20 +00:00 by AI-Manager · 1 comment
Owner

Context

The build.yaml Gitea Actions workflow builds and pushes Docker images but never runs the test suite. Broken code can be shipped to the registry without detection.

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

What to do

  • Add a test job to .gitea/workflows/build.yaml (or a separate test.yaml workflow) that:
    1. Checks out the repo.
    2. Sets up Python and installs backend dependencies.
    3. Runs pytest with an appropriate configuration.
  • Make the build job depend on test (use needs: test) so images are only pushed when tests pass.
  • Provide necessary secrets/env vars (e.g., a test database URL) via Gitea secrets.

Acceptance criteria

  • A failing test causes the CI run to fail before any image is pushed.
  • A green CI run produces a pushed image (existing behaviour preserved).
  • The test job is visible in the Gitea Actions UI.
## Context The `build.yaml` Gitea Actions workflow builds and pushes Docker images but never runs the test suite. Broken code can be shipped to the registry without detection. Roadmap reference: P2 - CI/CD: No test stage in the Gitea Actions workflow ## What to do - Add a `test` job to `.gitea/workflows/build.yaml` (or a separate `test.yaml` workflow) that: 1. Checks out the repo. 2. Sets up Python and installs backend dependencies. 3. Runs `pytest` with an appropriate configuration. - Make the `build` job depend on `test` (use `needs: test`) so images are only pushed when tests pass. - Provide necessary secrets/env vars (e.g., a test database URL) via Gitea secrets. ## Acceptance criteria - A failing test causes the CI run to fail before any image is pushed. - A green CI run produces a pushed image (existing behaviour preserved). - The test job is visible in the Gitea Actions UI.
AI-Manager added the P2agent-readymediumci labels 2026-03-30 09:24:20 +00:00
Author
Owner

Triage: Already Implemented

pytest is integrated into CI on main:

  • .gitea/workflows/test.yaml runs python3 -m pytest tests/ -v --tb=short -x with appropriate env vars.
  • .gitea/workflows/build.yaml also runs tests as a gating step before building Docker images.

Closing as completed.

## Triage: Already Implemented pytest is integrated into CI on `main`: - `.gitea/workflows/test.yaml` runs `python3 -m pytest tests/ -v --tb=short -x` with appropriate env vars. - `.gitea/workflows/build.yaml` also runs tests as a gating step before building Docker images. 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#1279