Repository navigation
ci: run unit tests on PRs and integration tests on merge to main - #235
Conversation
fbeaf7b to
ebd3a85
Compare
| - name: Set up Python | ||
| uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: '3.11' |
There was a problem hiding this comment.
I copied 3.11 from the other two jobs, and it is also the lowest version we support: requires-python = ">=3.11", and Ruff targets py311. Testing on the lowest supported version catches code that only works on newer Pythons, such as except*/TaskGroup-era APIs or 3.12+ typing syntax.
You have a point, though. CI never runs the versions we actually use: local dev is on 3.13 and the Dockerfile builds on python:3.14-slim. My suggestion is a small follow-up rather than changing only this job, since the three jobs should stay on the same version. It would run the unit job as a matrix on ["3.11", "3.14"], the lowest supported version and the one we ship in Docker, and keep the integration and live jobs on a single version. The unit run takes about 10s, so the second version costs almost nothing.
There was a problem hiding this comment.
PRs now run only the unit layer; a new `integration` job runs on pushes to main and on manual dispatch. `tests/conftest.py` marks each test from its directory, so a test missing its decorator (test_score_parity.py had none) still lands in the right job. Add a mocked end-to-end `vera pipeline` test: 1 persona, 4 turns, every LLM swapped for MockLLM at LLMFactory, through generate, judge, and score. Nothing ran the three real stages together without live providers before. It shares its config builder with the live test, so that file becomes test_vera_pipeline_e2e.py. The coverage floor goes from 30% to 68%, just under the unit layer's 70%; the integration job turns it off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ebd3a85 to
9f85132
Compare
Stacked on #234. This PR's base is that branch, so the diff shows only these changes.
Summary
CI split: the PR
testjob runs-m "not integration and not live". A newintegrationjob runs-m "integration and not live"only on push tomainand on manualworkflow_dispatch, so it can still be run on a branch before merging a risky change.Markers by directory: a
pytest_collection_modifyitemshook intests/conftest.pyaddsunitorintegrationbased on the test's directory. Where a test lives now decides which job runs it.test_score_parity.pyhad no marker and would otherwise have run on PRs.Mocked end-to-end
vera pipelinetest: 1 persona, 4 turns. Every LLM is replaced withMockLLMthrough a single patch onLLMFactory.create_llm, and the run goes through generate, judge, and score in 0.2s. Until now, no test ran the three real stages together without live providers. The test checks:results.csvcame from the mock judge;scores.jsonhas avera_score.It shares its config builder with the live test, so
test_vera_pipeline_live.pybecomestest_vera_pipeline_e2e.py.Coverage floor: 30% → 68%, just under the unit layer's 70%. The integration job passes
--cov-fail-under=0.Docs:
AGENTS.md,CLAUDE.md, and/testdescribe what runs where.The trade-off: a change that breaks only an integration test is now caught after merge, not before. Use
workflow_dispatchon the branch when a change touches pipeline wiring.Test plan
uv run pytest -m "not live": 1173 passed in 10s, 81% coverage-m "not integration and not live": 980 passed;-m "integration and not live": 193 passedtests/integration/is selected by-m "not integration"Integration Testsjob🤖 Generated with Claude Code