CI: add pytest test stage to Gitea Actions workflow that gates image builds #532

Closed
opened 2026-03-28 01:33:21 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 CI/CD — missing test stage

build.yaml builds and pushes Docker images but never runs pytest. Test failures are not caught in CI.

Task

  • Add a test job to .gitea/workflows/build.yaml that runs before the build job
  • The test job should: checkout code, set up Python, install dependencies, and run pytest
  • Make the build job depend on (needs: [test]) so a failing test blocks the image push
  • Pass required environment variables to the test job via secrets or test-specific env vars (mock or SQLite backend)

Acceptance Criteria

  • A test job exists in build.yaml and runs pytest
  • The build job only runs when test passes
  • A deliberately broken test causes the workflow to fail before pushing an image
  • The workflow runs successfully on a clean push with all tests passing
## Context Roadmap item: P2 CI/CD — missing test stage `build.yaml` builds and pushes Docker images but never runs `pytest`. Test failures are not caught in CI. ## Task - Add a `test` job to `.gitea/workflows/build.yaml` that runs before the build job - The test job should: checkout code, set up Python, install dependencies, and run `pytest` - Make the `build` job depend on (`needs: [test]`) so a failing test blocks the image push - Pass required environment variables to the test job via secrets or test-specific env vars (mock or SQLite backend) ## Acceptance Criteria - [ ] A `test` job exists in `build.yaml` and runs `pytest` - [ ] The `build` job only runs when `test` passes - [ ] A deliberately broken test causes the workflow to fail before pushing an image - [ ] The workflow runs successfully on a clean push with all tests passing
AI-Manager added the P2agent-readysmall labels 2026-03-28 01:33:21 +00:00
Author
Owner

Verified complete: Both test.yaml and build.yaml CI workflows include a pytest stage that runs python3 -m pytest tests/ -v --tb=short -x and gates the build jobs. Closing as implemented.

Verified complete: Both `test.yaml` and `build.yaml` CI workflows include a pytest stage that runs `python3 -m pytest tests/ -v --tb=short -x` and gates the build jobs. Closing as implemented.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#532