Add pytest test job to Gitea Actions CI workflow #1414

Closed
opened 2026-03-30 18:23:47 +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 but never runs the test suite. Broken code can be shipped to the registry without any automated validation.

What to do

  • Add a test job to build.yaml (or a separate test.yaml workflow) that:
    1. Sets up Python and installs dependencies (pip install -e .[dev] or pip install -r requirements-dev.txt).
    2. Runs pytest tests/ -v.
  • Make the build job depend on the test job so a failing test blocks the image push.
  • The test job should use a service container for PostgreSQL if the tests require it, or mock the DB connection.

Acceptance criteria

  • A pull request with a failing test causes CI to report failure before the image is built.
  • A pull request with passing tests proceeds to the build stage normally.
  • The workflow file is valid YAML and passes act or Giteas workflow linter.
## Context Roadmap item: P2 -- CI/CD -- No test stage in the Gitea Actions workflow `build.yaml` builds and pushes Docker images but never runs the test suite. Broken code can be shipped to the registry without any automated validation. ## What to do - Add a `test` job to `build.yaml` (or a separate `test.yaml` workflow) that: 1. Sets up Python and installs dependencies (`pip install -e .[dev]` or `pip install -r requirements-dev.txt`). 2. Runs `pytest tests/ -v`. - Make the `build` job depend on the `test` job so a failing test blocks the image push. - The test job should use a service container for PostgreSQL if the tests require it, or mock the DB connection. ## Acceptance criteria - [ ] A pull request with a failing test causes CI to report failure before the image is built. - [ ] A pull request with passing tests proceeds to the build stage normally. - [ ] The workflow file is valid YAML and passes `act` or Giteas workflow linter.
AI-Manager added the P2agent-readymediumci labels 2026-03-30 18:23:47 +00:00
Author
Owner

Triage: Already resolved in main.

.gitea/workflows/test.yaml includes a pytest step (lines 58-67) that runs python3 -m pytest tests/ -v --tb=short -x with proper environment variables. The build workflow (build.yaml) also runs pytest as a gate before building images. Closing as complete.

**Triage: Already resolved in main.** `.gitea/workflows/test.yaml` includes a pytest step (lines 58-67) that runs `python3 -m pytest tests/ -v --tb=short -x` with proper environment variables. The build workflow (`build.yaml`) also runs pytest as a gate before building images. Closing as complete.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1414