Repository navigation
Run the test suite on every pull request - #34
Conversation
Only CircleCI ran the tests, and it isn't connected to this repository, so pull requests merged with no tests run. tests.yml runs formatting, the build, Rust unit tests, the self-contained Python tests, the Go cancellation tests and the release images on every pull request and on main. Co-authored-by: Perplexity <noreply@perplexity.ai>
The Python tests were written against sqlparser 0.52 and didn't run on pull requests, so three expectations went stale with the upgrades: - 0.62 reads COPY ... FROM STDIN at the end of the query, so table_access refuses a gated table with 42501 instead of the query being refused unparsed with 0A000. - 0.64 reads ONLY in FROM as the inheritance marker, so `SELECT * FROM ONLY t` names t and table_access refuses it with 42501. `INSERT INTO ONLY t` is still read as a table named ONLY, so use it as the case refused unparsed. - 0.64 parses RESET, so an executed RESET ALL is counted under the identity it ran with instead of as an unparsed gap. The identity is still cleared. Co-authored-by: Perplexity <noreply@perplexity.ai>
A simple Query that clears the identity forgets it before the query is parsed and counted, so the SQL observer counts it as absent. In the extended protocol the reset applies once the statement has run, so it's counted as present. Co-authored-by: Perplexity <noreply@perplexity.ai>
artem-pplx
left a comment
There was a problem hiding this comment.
Verdict at e1fae411: clear, no blockers. CI is green in run 44377819503: 296 Python tests passed, 14 xfailed, both Go cancellation tests passed, and rustfmt and both images passed.
tests.ymlis unchanged since9f47551a, the commit this review read in full.- Nonblocking, worth fixing before these checks become required:
- The test binary depends on the allocator script's feature build (inline at line 53).
- The Go tests are skipped whenever Python fails (inline at line 95).
- Smaller items are inline:
persist-credentials, the disk-usage steps, the cache key,concurrency, andapt-get update. - Checked and correct:
- The Python exclusions are exactly the three files that need the multi-server CircleCI setup.
- The 1.97.1 toolchain matches
Dockerfileandrust-version. - The image job's port, config and exit-code-78 assumptions hold.
- Every
sleep 1is inside a bounded readiness loop followed by a hard check. - The four action SHAs match their tag comments.
- Safe for a public repo: a
pull_requesttrigger,contents: read, no secrets, nopull_request_target.
- Test-expectation commits (
b5f6a67d,e1fae411):- On
9f47551athe 3 failures came from main's behaviour after the parser upgrades, not from the workflow. The environment was sound: 293 passed, 0 skipped. - The updated expectations match main.
COPY t FROM STDINandSELECT … FROM ONLY tare now parsed and refused by the table check (42501).INSERT INTO ONLY tis still refused as unparsed (0A000), persrc/query_router.rs:567-571. Every case that expected a refusal still expects one. - The
RESET ALLobserver labels matchreset_sessioninsrc/client.rs:presentfor the extended protocol andabsentfor the simple protocol.
- On
Description (nonblocking).
- It says "
test:cargo build, the allocator build check,cargo test --features test-plugins, the Python tests …, and the Go cancellation tests." The Python and Go tests rely on the allocator check's feature build, and the Go tests run only when every earlier step passes. - Suggested wording after the fixes: "
test: builds pgcat and the plugin examples with--features test-plugins, runs the allocator build check,cargo test --features test-plugins, the Python tests that start their own pgcat (withPGCAT_TEST_PLUGINS=1and psql 18 from apt.postgresql.org), and the two Go cancellation tests, all against onepostgres:14." - The description also doesn't mention the three updated Python expectations. Suggested line under "Change": "Updates
test_copy.py,test_plugin_hooks.pyandtest_sql_observer.pyexpectations that went stale with the sqlparser upgrades (#27, #29). They never ran in CI, so the break went unseen."
Limits.
- One review pass of the workflow by Claude Opus at medium effort, which is allowed because this is CI-only with runtime unchanged. I then checked the expectation delta against the source directly.
- I read the CI logs and parsed the YAML. I didn't run the suite locally.
Created with Perplexity
|
Follow-ups outside this PR (not blocking):
Created with Perplexity |
The Python and Go tests run target/debug/pgcat, and the plugin tests need it built with test-plugins. It only had the feature because the allocator check rebuilt it. Build it, the other binaries and the examples with the feature directly. Run the Go cancellation tests before the Python tests, so a Python failure no longer skips them. Also drop the checkout's persisted credentials, the mid-job disk usage step and the constants repeated in the cache key, cancel superseded pull request runs, and update the apt lists before installing psql. Co-authored-by: Perplexity <noreply@perplexity.ai>
|
Delta
The description now matches the head. Run 44378953120 is green: Python 296 passed with 14 xfailed, both Go tests passed, and rustfmt and both images passed. The ledger items stay as follow-ups. Delta checked directly by the coordinating reviewer (Claude Opus), on top of the earlier single medium-effort pass. Comment-only. Created with Perplexity |
Why
The test suite only runs in CircleCI (
.circleci/config.yml), and CircleCI isn't connected to this repository. Pull requests here report no checks and merge with no tests run, as #33 did.Change
Adds
.github/workflows/tests.yml, run on every pull request and on pushes tomain:test: builds pgcat and the plugin examples with--features test-plugins, runs the allocator build check,cargo test --features test-plugins, the two Go cancellation tests, and the Python tests that start their own pgcat (withPGCAT_TEST_PLUGINS=1and psql 18 from apt.postgresql.org), all against onepostgres:14. The Go tests run before the Python tests, so a Python failure doesn't skip them.test_auth.py,test_pgcat.pyandtest_asyncpg.pyneed the CircleCI multi-server setup and stay excluded.rustfmt:cargo fmt --checkfor the workspace andtests/rust.image: buildsDockerfileandDockerfile.dev, checks that each servesSELECT 1with its shipped config, and that each exits withexitcode::CONFIGon a config naming an unregistered plugin.Actions are pinned by SHA, which the repository requires. Superseded pull request runs are cancelled.
Updates
test_copy.py,test_plugin_hooks.pyandtest_sql_observer.pyexpectations that went stale with the sqlparser upgrades (#27, #29). They never ran in CI, so the break went unseen. The updates don't change pgcat's behavior:COPY t FROM STDINnow parses, sotable_accessrefuses a gated table with42501, not0A000as unparsed.SELECT * FROM ONLY tnow namest, sotable_accessrefuses it with42501.INSERT INTO ONLY t, still read as a table namedONLY, is the case refused unparsed.RESET ALLnow parses, so the SQL observer counts it as a statement instead of as an unparsed gap: under the caller's identity when executed in the extended protocol, and without one as a simple Query, which forgets the identity before it runs. The identity is still cleared.Not in this PR
.circleci/is left as is.mainruleset), not a file change. It can be done once this workflow has run green onmain.Created with Perplexity