ci(fork): add pytest-run job with Postgres service container#2
Closed
HaraldeRoessler wants to merge 3 commits into
Closed
ci(fork): add pytest-run job with Postgres service container#2HaraldeRoessler wants to merge 3 commits into
HaraldeRoessler wants to merge 3 commits into
Conversation
Previously the fork CI only ran pytest --collect-only, never executing any tests. This meant regressions like the PR#17 credit-middleware 402-block loss were invisible to CI — the concurrency test (test_concurrent_deducts_respect_balance) would have caught it immediately, but it never ran. New job: - pytest-run: spins up a Postgres 16 service container, runs init_db.sql for the schema, executes tests/test_credit_middleware.py with proper env vars (CREDITS_ENABLED=true, MOLTSTACK_DB_PW, etc.) This is intentionally scoped to credit middleware tests only — the test_caep.py and protocol compliance tests need additional infrastructure (sandbox, admin keys) and can be added separately. Also adds httpx to the collect job's pip install (needed for import to succeed).
Owner
Author
|
Superseded — CI changes moved to PR#58 (MoltyCel#58) |
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 fork CI previously only ran
pytest --collect-only— tests were never executed. This meant regressions like the PR#17 credit-middleware 402-block loss were invisible to CI.The concurrency test
test_concurrent_deducts_respect_balancewould have caught it immediately (expects 3×200 + 7×402, got 10×200) — but it never ran.What's added
pytest-runjob — spins up a Postgres 16 service container, runsinit_db.sqlfor the schema, then executestests/test_credit_middleware.pywith proper env vars:Scoped to credit middleware tests for now. Other test files (test_caep.py, test_protocol_compliance.py) need additional infrastructure and can follow separately.
Also adds
httpxto pip install in the collect job (needed for imports to succeed).Why this matters
The entire PR#17 regression was discovered by Kersten running tests manually on the production server. With this CI job, the red test blocks the merge automatically.