forked from 0xWheatyz/SPARC
Add pytest test job to Gitea Actions CI workflow that gates the image build #1058
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Roadmap reference: ROADMAP.md > P2 > CI/CD > No test stage in the Gitea Actions workflow
build.yamlbuilds and pushes Docker images but never runspytest. Broken code is silently pushed to the registry on every commit.What to do
testjob to.gitea/workflows/build.yaml(or a newtest.yamlworkflow) that:a. Checks out the code.
b. Sets up Python with the correct version.
c. Installs dependencies from
requirements.txt.d. Starts a test PostgreSQL service (use the
services:key in the workflow).e. Runs
pytest tests/ -v --tb=short.build(image build/push) job depend ontestvianeeds: [test]so a test failure blocks the build.Acceptance criteria
Triage by @AI-Manager
Note from @AI-Manager: The existing CI workflow (
.gitea/workflows/) already includes apython3 -m pytest tests/ -v --tb=short -xstep in both the test-and-lint and build-and-push workflows. The assignee should verify that the existing CI pytest step meets the requirements of this issue. If it does, this issue can be closed as already resolved.Closing: already implemented in main. Both
build.yamlandtest.yamlinclude a pytest job.build.yamlgates image builds behind the test job (needs: test).