Cover verify-results-pgtap.sh's regression.diffs classification - #85
Open
jnasbyupgrade wants to merge 5 commits into
Open
jnasbyupgrade wants to merge 5 commits into
jnasbyupgrade wants to merge 5 commits into
Conversation
Paired with pgxntool commit ec7c7ee, which lets `make results` seed the first expected output for a brand-new test (pgxntool issue #119). New `test/standard/verify-results-pgtap-script.bats` owns the script's decision logic, invoked directly against a scratch directory with no Make, foundation environment or PostgreSQL: the no-baseline exemption, a real mismatch still blocking, an unblessed file holding a SQL error still blocking, unrecognized `regression.diffs` content failing closed, classification driven by unprefixed `diff `/`@@ ` headers rather than diffed content, and the pre-existing `not ok`/TODO/plan-mismatch scan. `make-test.bats` keeps only what needs a real `pg_regress` run: that `make results` really does seed a new test's first expected output end-to-end, and that `make verify-results` invokes the script and propagates its failure. Its TODO and plan-mismatch cases moved to the script-level file rather than paying for a full `make verify-results` run each to re-test logic decided entirely inside the script. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 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 |
`make results` blesses every `test/results/*.out` into `test/expected/`, so a leftover `results/brand_new.out` would reappear as an orphaned expected file for `check-stale-expected` the next time any test in this environment runs `make results`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Paired with pgxntool commit 93aa10f. The script's fail-closed claims were asserted in the PR body but only partly tested, and two of them weren't true: an empty `regression.diffs` and junk following a valid block both passed. Adds script-level coverage for an empty `regression.diffs`, a block with no hunks (also what a pre-12 context diff degrades to) and one with only some `@@ -0,0` hunks, unrecognized content after a valid block, and both of psql's real error renderings -- column 0 and the `psql:<file>:<line>:` prefix an \i'd file produces -- plus the passing test whose description merely mentions `ERROR:`, which used to be blocked. The end-to-end `make results` test now asserts the "no expected output yet" message, so it can't pass on a file that appeared some other way. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`\ No newline at end of file` is part of the diff format, so the new unrecognized-content check must not read it as junk -- doing so would block the first bless of any test whose output lacks a trailing newline. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diff body lines with no `diff ` header before them produce no classification rather than an unrecognized one, so they reach a separate guard from the junk case above it. Both have to block; only one was tested. Co-Authored-By: Claude Opus 5 (1M context) <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.
Test coverage for pgxntool PR Postgres-Extensions/pgxntool#121, which lets
make resultsseed the first expected output for a brand-new test (pgxntool issue #119).New
test/standard/verify-results-pgtap-script.batsownsverify-results-pgtap.sh's decision logic, invoking the script directly against a scratch directory with no Make, no foundation environment and no PostgreSQL — the layeringCLAUDE.mdprescribes, modeled oncheck-stale-expected-script.bats. It covers:@@ -0,0hunk) now passingregression.diffspg_regressfeeds psql on stdin) and thepsql:<file>:<line>:prefix an\i'd file produces — a column-anchored match would miss the second, which is whatsetup.sql/finish.sqlgenerateERROR:being blessed rather than permanently refusedregression.diffsblocking (pg_regressbailed before comparing anything;test/results/holds a stale run)@@ -0,0hunks\ No newline at end of filemarker still doesn'tdiff/@@headers, not by diffed content that looks like a header (both directions: a+@@ ...line inside added content, and a deleted-- commentrendering as--- comment)not ok/# TODO/ plan-mismatch scanmake-test.batskeeps only what genuinely needs a realpg_regressrun: an end-to-end test thatmake resultsseeds a brand-new test's first expected output — asserting theno expected output yetmessage, so it can't pass on a file that appeared some other way — and one wiring test thatmake verify-resultsinvokes the script and surfaces its failure. Its TODO and plan-mismatch cases moved into the script-level file rather than paying for a fullmake verify-resultsrun each to re-test logic decided entirely inside the script.Test plan
test/standard/verify-results-pgtap-script.bats: 16/16 pass.test-allagainst a local pgxntool with pgxntool PR #109 merged in: 273/273 pass, 0 failed, 0 skipped, including every test added or changed here.regression.diffsand junk-after-a-block fixtures exit 0 there (fail-open) and 1 now; theERROR:-in-a-description fixture exits 1 there (false positive) and 0 now.test-allagainst pgxntoolmasteras it stands today: 14 failures, 0 skipped. All 14 are pre-existing and unrelated to this PR, and CI reproduces exactly the same 14 — they are the tests merged in Cover test-build ordering, build-results, and test/install ON_ERROR_STOP #79 for pgxntool PR #109 (check-test-install-error-stop.sh,build-results,test-buildordering, the dist manifest entry for that script, andtest/installmarker state). That PR is still open, so the script and targets those tests exercise don't exist in pgxntoolmasteryet; the script-level ones fail with exit 127, "No such file or directory". CI here cannot go green until #109 lands, independently of this PR.