Add local pytest integration tests for the targetDB CI workflow - #148
Merged
Conversation
The Test Database CI workflow was the only way to exercise the full create-db -> q3c -> schema -> insert pipeline, and it only checked command exit codes. Add a Docker-backed pytest suite (tests/integration/) that reproduces the same CLI sequence locally and verifies the inserted rows via SQL, so this can be run and debugged without pushing to GitHub. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
tests/integration/) that reproduces the samepfs-targetdb-clisequence as.github/workflows/test_database.yml(create-db → q3c → schema → insert example data → prep-fluxstd → transfer/insert targets → insert-pointings → update-catalog-active), so it can be run and debugged locally without pushing to GitHub.tests/docker/provides a dedicatedpostgres:16+ Q3C image and compose file (tmpfs data dir, isolated port 15433) so the suite never touches a developer's existing Postgres/examples/docker/setup.--keep-dbflag leaves the container running for post-failure inspection..github/workflows/test_database.ymlis unchanged; this is a local-only addition for now.Test plan
uv run pytest tests -v→ 22 passed, 1 skippeduv run pytest tests -m "not integration"→ integration tests deselected, unit tests still rundockerremoved fromPATH→ all integration tests skip with an explanatory reason; unit tests still passuv run pytest tests/integration -v --keep-db→ container stays up and reachable afterwards; manually torn down withdocker compose -f tests/docker/docker-compose.test.yml down -vdocker ps -a/docker volume lsshow no leftover resources after a normal rungit statusclean after a run —examples/data/is never written to (all generated files go to a pytest tmp dir)🤖 Generated with Claude Code