Skip to content

ci: run pytest in CI - #150

Merged
monodera merged 2 commits into
mainfrom
ci/run-pytest-in-ci
Aug 5, 2026
Merged

ci: run pytest in CI#150
monodera merged 2 commits into
mainfrom
ci/run-pytest-in-ci

Conversation

@monodera

@monodera monodera commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The test suite has never run in CI. grep -rn "pytest" .github/workflows/ finds only an unused uv pip install pytest-cov and a commented-out invocation. The 30 tests in tests/, including the Postgres integration suite added in 362f982, have only ever run on developer machines.

test_database.yml exercises pfs-targetdb-cli end to end and generates ER diagrams, but it is not a test-suite runner. This adds a Test workflow that runs the suite on every PR.

Notes

  • No services: block is needed. tests/docker/docker-compose.test.yml builds its own Postgres + Q3C image, stores data in tmpfs and defines a healthcheck; the fixtures start and stop it themselves. tests/conftest.py skips the integration tests when Docker is unavailable, so the same command works on runners with and without it.
  • test_database.yml is unchanged. It produces ER diagrams, a separate deliverable. The integration fixtures deliberately duplicate its CLI sequence — tests/integration/conftest.py says 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.skip on tests/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 under docs/, because docs/ 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 F401 suppression in the companion PR is defensive, not load-bearing: models/__init__.py registers 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

monodera and others added 2 commits August 4, 2026 17:45
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
monodera force-pushed the ci/run-pytest-in-ci branch from 0b9fe59 to c6c5ada Compare August 4, 2026 08:46
@monodera
monodera merged commit 6b34bd1 into main Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant