Repository navigation
Test verify-tap.sh, the standalone TAP output checker - #109
jnasbyupgrade wants to merge 2 commits into
Conversation
Add tests for pgxntool commit 5595355 (Postgres-Extensions/pgxntool#143): - New `verify-tap.sh [FILE|-]...` fails on `not ok` without `# TODO`, `Bail out!`, pgTAP plan mismatches, and missing, duplicate or misplaced plan lines; exits 0, 1 or 2 - `make results` (pgtap mode) uses it on TAP-bearing result files `verify-tap-script.bats` invokes the script directly on scratch files and stdin: every pass/fail rule, no-TAP input, stdin naming and stderr-only diagnostics, multiple files with one failing, and exit code 2 for usage errors or an unreadable file. `verify-results-pgtap-script.bats` adds a case showing a missing plan line now blocks while plain-SQL output is left alone, and keeps its SQL error case exercising the `regression.diffs` scan by giving it a complete plan. Also list `verify-tap.sh` in the expected dist files and in CLAUDE.md's hand-invoked scripts.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add tests for pgxntool commit 409787f (Postgres-Extensions/pgxntool#143): - `verify-tap.sh --skip-non-tap` skips input with no TAP lines - `make test` runs `verify-tap.sh --skip-non-tap` on results under the default `pgtap` mode, not under `diffs` `verify-tap-script.bats` folds `--skip-non-tap` into the existing no-TAP test: a plain-SQL file passes silently with the flag, a failing TAP file beside it is still judged wherever the flag goes, and stdin works too. `make-test.bats` adds `make -n test` checks for both modes to the existing mode-selection test, plus one end-to-end case: a `not ok` blessed with `make results PGXNTOOL_ENABLE_VERIFY_RESULTS=no` makes `make test` fail with no `regression.diffs`.
|
Claude finished @jnasbyupgrade's task in 28s —— View job Review of PR #109I read the diff only. I couldn't read Overall: The test layering follows CLAUDE.md. Decision logic is tested directly against the script. The Makefile layer is tested with Suggestions
What looks good
|
Tests for Postgres-Extensions/pgxntool#143, which adds
pgxntool/verify-tap.sh [--skip-non-tap] [FILE|-]...(a standalone TAP output checker) and makesmake resultsandmake testuse it inpgtapmode.test/standard/verify-tap-script.bats(new) invokes the script directly on scratch files and stdin, with no foundation,makeor PostgreSQL: each pass/fail rule (not okwithout# TODO,Bail out!, pgTAP's "Looks like you planned", missing/duplicate/misplaced plan line, count mismatch,1..0, subtests ignored), no-TAP input with and without--skip-non-tap(including beside a failing TAP file and on stdin), stdin via a pipe and via-with diagnostics on stderr only, multiple files with one failing, and exit code 2 for usage errors or an unreadable file.test/standard/verify-results-pgtap-script.bats: a new case shows a missing plan line now blocksmake resultswhile plain-SQL output is left alone. The SQL-error case now gives its fixture a complete plan, so it still exercises theregression.diffsscan instead of being caught by the new count check.test/standard/make-test.bats:make -n testdry-runs show thetest:recipe invokesverify-tap.sh --skip-non-tapunderpgtapand not underdiffs(folded into the existing mode-selection test), and one end-to-end case blesses anot okwithmake results PGXNTOOL_ENABLE_VERIFY_RESULTS=noand showsmake testthen fails with noregression.diffs.verify-tap.shis added totest/lib/dist-expected-files.txtand to CLAUDE.md's list of hand-invoked scripts in the user-facing API surface.No new helpers and no template change.
Merge order
Merge Postgres-Extensions/pgxntool#143 first. This is an addition: these tests need a script that only exists on that branch, so merging this first would break CI for unrelated pgxntool-test PRs.