ci: run pytest in CI - #150
Merged
Merged
Conversation
The test suite has never run in CI. test_database.yml exercises the CLI end to end and generates ER diagrams, but does not invoke pytest, so the 30 tests in tests/ have only run on developer machines. Runs the full suite including the Docker-backed integration tests, which manage their own Postgres stack via tests/docker/docker-compose.test.yml and need no services: block. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
monodera
force-pushed
the
ci/run-pytest-in-ci
branch
from
August 4, 2026 08:46
0b9fe59 to
c6c5ada
Compare
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
The test suite has never run in CI.
grep -rn "pytest" .github/workflows/finds only an unuseduv pip install pytest-covand a commented-out invocation. The 30 tests intests/, including the Postgres integration suite added in 362f982, have only ever run on developer machines.test_database.ymlexercisespfs-targetdb-cliend to end and generates ER diagrams, but it is not a test-suite runner. This adds aTestworkflow that runs the suite on every PR.Notes
services:block is needed.tests/docker/docker-compose.test.ymlbuilds its own Postgres + Q3C image, stores data in tmpfs and defines a healthcheck; the fixtures start and stop it themselves.tests/conftest.pyskips the integration tests when Docker is unavailable, so the same command works on runners with and without it.test_database.ymlis unchanged. It produces ER diagrams, a separate deliverable. The integration fixtures deliberately duplicate its CLI sequence —tests/integration/conftest.pysays so in its own docstring — so CI now performs that database setup twice. Consolidating the two is worthwhile but larger than this change, and is recorded as follow-up in the design document.Verified locally
Full suite with Docker running: 29 passed, 1 skipped, with all 21 Docker-backed integration tests executing rather than skipping. The single skip is an unconditional
@pytest.mark.skipontests/test_clustering.py::test_run_clustering, unrelated to this change.Also included
specs/gains the design and implementation-plan documents for this work and its companion PR. They are placed at the repository root rather than underdocs/, becausedocs/is the mkdocs source and anything dropped there is published to the GitHub Pages site.The final commit corrects both documents against what implementation actually found — most importantly that the
F401suppression in the companion PR is defensive, not load-bearing:models/__init__.pyregisters the model first,configure_mappers()succeeds without the import, and the test suite returns an identical result either way. The decision to keep the import stands; only the claimed evidence was wrong.🤖 Generated with Claude Code