Skip to content

Test make test's pgTap output check and pgtap-only mode - #107

Open
jnasbyupgrade wants to merge 7 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:issue-106-tap-output-check
Open

jnasbyupgrade wants to merge 7 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:issue-106-tap-output-check

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

This adds test coverage for Postgres-Extensions/pgxntool#141, for Postgres-Extensions/pgxntool#106. That PR makes make test fail on pgTap failures in actual output (a not ok without # TODO, a missing or duplicate plan, or a plan/count mismatch, in test/results and test/install output), adds PGXNTOOL_VERIFY_RESULTS_MODE=pgtap-only, and fixes test/install under a separate TESTOUT.

Merge order: merge Postgres-Extensions/pgxntool#141 first. These tests exercise behavior that exists only on that branch, so merging this PR first would break CI for every other pgxntool-test PR until #141 lands.

  • New check-tap-output-script.bats runs the script directly. It covers every failure rule, non-TAP pass-through, 1..0, subtests, nonexistent arguments and --list.
  • verify-results-pgtap-script.bats covers the plan checks, the extra-file arguments (the test/install outputs), and --pgtap-only with and without --for-test: a description-only TAP diff passes there and fails under plain pgtap, a non-TAP diff still fails, and a TAP test with a SQL error line fails.
  • make-test.bats covers wiring only:
    • the arguments, through a dry run, including pgtap-only's use of verify-results-pgtap.sh --pgtap-only --for-test;
    • the PGXNTOOL_VERIFY_RESULTS_MODE=diffs skip and exit-status propagation, through a stub;
    • PGXNTOOL_VERIFY_RESULTS_MODE validation for the new value;
    • one end-to-end case, where a blessed not ok fails make test.
  • test-test-install.bats checks, without Postgres, that _test-install-output-link creates the $(TESTOUT)/install symlink for a separate TESTOUT and fails on a pre-existing directory there.
  • pgxntool-variables.txt and dist-expected-files.txt are updated for the new variables and script.

Add tests for Postgres-Extensions/pgxntool#141
(commit d62a875, part of Postgres-Extensions/pgxntool#106):
- `make test` fails on pgTap failures, missing or duplicate plans and
  plan/count mismatches in `test/results` and `test/install` output
- `verify-results-pgtap.sh` uses the same check, with the `test/install`
  outputs as extra arguments

- New `check-tap-output-script.bats` invokes the script directly and
  covers each failure rule, non-TAP pass-through, `1..0`, subtests and
  nonexistent arguments.
- `verify-results-pgtap-script.bats` covers the plan checks and the
  extra file arguments.
- `make-test.bats` covers wiring only: the arguments (dry run), the
  `PGXNTOOL_ENABLE_CHECK_TAP_OUTPUT=no` skip and exit-status propagation
  (stub), and one end-to-end case where a blessed `not ok` fails
  `make test`.
- Add the new variables to `pgxntool-variables.txt` and the new script
  to `dist-expected-files.txt`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0947d5e2-0bb9-470d-9859-63779ad14e82

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

jnasbyupgrade and others added 4 commits October 12, 2026 18:37
…heck

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add tests for Postgres-Extensions/pgxntool@3e8be3f (part of
Postgres-Extensions/pgxntool#141): with
`TESTOUT` different from `TESTDIR`, `_test-install-output-link` makes
`$(TESTOUT)/install` a symlink to `$(TESTDIR)/install`, and fails
rather than replace a pre-existing directory there.

Both checks run without Postgres, folded into the existing schedule
test in `test-test-install.bats`.
Add tests for Postgres-Extensions/pgxntool@15e558b (part of
Postgres-Extensions/pgxntool#141, for
Postgres-Extensions/pgxntool#106):

- `verify-results-pgtap-script.bats`: under `--pgtap-only` (with and
  without `--for-test`), a TAP test whose only difference is its
  description passes, and fails under plain pgtap; a non-TAP diff
  still fails; a TAP test with a SQL error line fails.
- `check-tap-output-script.bats`: `--list` names only TAP files.
- `make-test.bats`: the mode validation tests cover `pgtap-only` and
  its parse-time error with `PGXNTOOL_ENABLE_CHECK_TAP_OUTPUT=no`, and
  a dry run shows `make test` and `verify-results` using the new
  logic.
@jnasbyupgrade jnasbyupgrade changed the title Test make test's pgTap output check Test make test's pgTap output check and pgtap-only mode Oct 15, 2026
Update tests for Postgres-Extensions/pgxntool@7eec927 (part of
Postgres-Extensions/pgxntool#141, for
Postgres-Extensions/pgxntool#106):

- `make-test.bats`: the dry-run and stub tests prove
  `PGXNTOOL_VERIFY_RESULTS_MODE=diffs` skips the TAP check, instead of
  the removed variable; drop its invalid-value test and the
  `pgtap-only` conflict assertion.
- `pgxntool-variables.txt`: drop the variable from the inventory.
A bare Postgres-Extensions#106 in pgxntool-test resolves to this repo's PR, so the
reference now names Postgres-Extensions/pgxntool#106.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant