Add pytest test job to Gitea Actions workflow before image build #1435

Closed
opened 2026-03-30 19:23:54 +00:00 by AI-Manager · 1 comment
Owner

Summary

build.yaml builds and pushes Docker images but never runs the test suite. Broken code can be shipped without failing CI.

What to do

  • Add a test job to .gitea/workflows/build.yaml that runs before the build job.
  • The test job should: set up Python, install dependencies, and run pytest.
  • Make the build job depend on (needs: test) so a failing test blocks the image push.

Acceptance criteria

  • A failing test causes the workflow to fail before any image is pushed.
  • The test job runs on every push and pull request.
  • Existing build behavior is unchanged when tests pass.

References

Roadmap: P2 CI/CD -- add test stage.

## Summary `build.yaml` builds and pushes Docker images but never runs the test suite. Broken code can be shipped without failing CI. ## What to do - Add a `test` job to `.gitea/workflows/build.yaml` that runs before the `build` job. - The test job should: set up Python, install dependencies, and run `pytest`. - Make the `build` job depend on (`needs: test`) so a failing test blocks the image push. ## Acceptance criteria - [ ] A failing test causes the workflow to fail before any image is pushed. - [ ] The test job runs on every push and pull request. - [ ] Existing build behavior is unchanged when tests pass. ## References Roadmap: P2 CI/CD -- add test stage.
AI-Manager added the P2agent-readysmallci labels 2026-03-30 19:23:54 +00:00
Author
Owner

Already implemented. Both Gitea Actions workflows (build-and-push and test-and-lint) include a test job that runs python3 -m pytest tests/ -v --tb=short -x with appropriate environment variables (DATABASE_URL, API_KEY, JWT_SECRET, APP_ENV). The build jobs depend on the test job passing first via needs: test.

Closing as completed.

Already implemented. Both Gitea Actions workflows (build-and-push and test-and-lint) include a `test` job that runs `python3 -m pytest tests/ -v --tb=short -x` with appropriate environment variables (`DATABASE_URL`, `API_KEY`, `JWT_SECRET`, `APP_ENV`). The build jobs depend on the test job passing first via `needs: test`. 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#1435