ci(github-actions): add pytest workflow for unit suite#2
Open
Dhruv-Davda wants to merge 1 commit into
Open
Conversation
The repo ships with 384 pytest tests (per the README) and a configured pytest.ini with markers (unit, integration, slow) but no GitHub Actions workflow to enforce green tests on pull requests. This change adds the minimal CI surface so contributors get fast feedback without having to spin up the full Docker stack locally. Workflow design: - Triggers on push to main and on PRs targeting main. - Sets up Python 3.11 with pip dependency caching keyed on requirements.txt + requirements-test.txt. - Installs requirements-test.txt (which transitively pulls requirements.txt) and runs pytest with -m "not integration and not slow", excluding the markers documented in pytest.ini that need live Postgres + RabbitMQ. - Disables the global --cov-fail-under=80 gate in CI runs because the hermetic subset covers a smaller surface than the full suite; teams can re-enable it in a dedicated integration-test job once services are provisioned in CI. - Uploads coverage.xml and htmlcov/ as artifacts (14-day retention). - Uses concurrency.cancel-in-progress so stale runs on the same branch get cancelled when a newer commit lands. Zero existing files modified; pure addition of a single workflow file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a GitHub Actions workflow that runs the pytest unit suite on every push to
mainand every pull request, so contributors get fast feedback without spinning up the full Docker stack locally. The repo already has 384 pytest tests and a well-configuredpytest.iniwithunit/integration/slowmarkers - this change wires those into automated CI.What's in the box
.github/workflows/ci.ymlunit-tests) that runspytest -m "not integration and not slow"on Python 3.11 with pip caching, uploads coverage artifacts, and usesconcurrency.cancel-in-progressto drop stale runs.Zero existing files modified.
Design notes
pytest.inias requiring Postgres + RabbitMQ) are excluded from CI. A future job can run them against a Docker-Compose-spun-up service matrix on a dedicated trigger.pytest.inienforces--cov-fail-under=80, but that threshold reflects the full-suite surface. The hermetic CI subset doesn't exercise the same code paths, so the workflow uses--cov-fail-under=0and still uploads coverage as artifacts. The global gate stays useful for local full-suite runs.actions/setup-pythoncaches pip based onrequirements.txt+requirements-test.txt, so subsequent runs install in seconds.Out of scope (deliberate follow-ups)
lintjob (ruff check,ruff format --check) and atype-checkjob (mypy). Both tools are already pinned inrequirements-test.txt. Splitting them off keeps this PR small and focused; happy to add either in a follow-up.Verification
The workflow itself runs on this PR - once opened, GitHub Actions will execute it against the head commit. If the unit subset surfaces any environment-specific failures we couldn't reproduce locally, happy to iterate.
Posting this alongside an application to DMP 2026 / theapprenticeproject/C4GT_2026#2 (the cost-efficient VLM evaluator project for TAP Buddy). Engaging with
tap_plgfirst because its CLIP-based image-embedding stack is the closest analogue to the vision-model work the DMP project targets.