Skip to content

Support TESTOUT for test/install and test/build - #145

Open
jnasbyupgrade wants to merge 2 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:testout-support
Open

jnasbyupgrade wants to merge 2 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:testout-support

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

make test TESTOUT=<dir> now works when test/install is in use, and test-build's actual output follows TESTOUT as well.

test/install (bug fix). Each test/install file's actual output goes to $(TESTOUT)/results/../install/<name>.out, but its expected output is read from $(TESTDIR)/expected/../install/<name>.out. The two are the same file only when TESTOUT equals TESTDIR. With any other TESTOUT, make test aborted with "Directory nonexistent" and then "Bail out!". When test/install is enabled and TESTOUT differs, a new order-only prerequisite of installcheck (_test-install-output-link) makes $(TESTOUT)/install a symlink to $(TESTDIR)/install. If anything else is already at that path, the build fails instead of replacing it. Nothing changes when TESTOUT equals TESTDIR. So test/install output always lands in $(TESTDIR)/install/, which is gitignored.

test/build (behavior change, separate commit). test-build passes --outputdir=$(TESTOUT)/build instead of $(TESTDIR)/build. results-build follows the same path: it reads regression.diffs and copies from $(TESTOUT)/build/results/. Input .sql files and expected output stay in $(TESTDIR)/build/. This commit can be dropped at review without affecting the test/install fix.

README.asc's TESTOUT section now says exactly what TESTOUT moves and what it does not. HISTORY.asc has an entry for each change.

Verification

The scratch reproduction builds a repo from the pgxntool-test template and runs make test TESTOUT=$(mktemp -d):

  • On master: rc=2. The run fails with cannot create .../results/../install/create_install_marker.out: Directory nonexistent, then Bail out!.
  • On this branch: rc=0, with all 4 main-suite tests and both test-build tests passing. <dir>/install is a symlink to test/install. test-build output is in <dir>/build/results/, and test/build/ gets no results/.

Coordination

#144 also edits README.asc's test/install section. Whichever of the two PRs merges second will probably need a conflict fix there, and in README.html.

Paired pgxntool-test PR to follow. Merge this PR first.

`pg_regress` writes `test/install` actual output to
`$(TESTOUT)/results/../install/<name>.out` but reads its expected
output from `$(TESTDIR)/expected/../install/<name>.out`. Those are the
same file only when `TESTOUT` equals `TESTDIR`; otherwise `make test`
aborted with "Directory nonexistent" and "Bail out!".

When `test/install` is enabled and `TESTOUT` differs from `TESTDIR`,
the new `_test-install-output-link` (an order-only prerequisite of
`installcheck`) makes `$(TESTOUT)/install` a symlink to
`$(TESTDIR)/install`, so test/install output always lands in
`$(TESTDIR)/install/`. Anything else already at that path fails the
build rather than being replaced.

Related changes in pgxntool-test:
- Test that the rule creates the symlink for a separate `TESTOUT` and
  fails on a pre-existing directory
- Test that `make test TESTOUT=<dir>` passes on the template
`test-build` now passes `--outputdir=$(TESTOUT)/build` instead of
`$(TESTDIR)/build`, so its `results/` and `regression.diffs` go to
the same place as the main suite's output. `results-build` reads its
diffs and copies its actual output from `$(TESTOUT)/build/` to match.
Input `.sql` files and expected output stay in `$(TESTDIR)/build/`, and
nothing changes with the default `TESTOUT`.

Related changes in pgxntool-test:
- Dry-run check that `test-build`'s `--outputdir` follows `TESTOUT`
- `make test TESTOUT=<dir>` leaves test-build output in `<dir>/build/`
@coderabbitai

coderabbitai Bot commented Oct 16, 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: 3f5644d0-7a59-4087-a264-76ac85e3e5a5

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.

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