Skip to content

Test that installcheck creates a missing test/sql/ - #100

Merged
jnasbyupgrade merged 1 commit into
Postgres-Extensions:masterfrom
jnasbyupgrade:pre-2.4.0-testsql-dir-rule
Oct 7, 2026
Merged

jnasbyupgrade merged 1 commit into
Postgres-Extensions:masterfrom
jnasbyupgrade:pre-2.4.0-testsql-dir-rule

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

Summary

Adds coverage for Postgres-Extensions/pgxntool#133. That PR fixes make test failing with No rule to make target 'test/sql/', needed by 'installcheck' in a project with no test/sql/ directory.

The new @test in test/standard/base-mk-misc.bats runs make -n installcheck with TESTDIR pointed at a directory that doesn't exist. It asserts that make succeeds and prints mkdir -p for sql/, expected/ and results/.

  • Why a dry-run: what's broken is whether Make can resolve a rule for each prerequisite. make -n shows that without Postgres or a real pg_regress run, so no end-to-end test is needed.
  • Why override TESTDIR: setup.sh always creates test/sql/, so the foundation environment can't show the bug. Pointing TESTDIR at a fresh scratch path reproduces it without moving directories in the shared test environment.

Proven both ways:

  • Against pgxntool master (before the fix): the test fails with make: *** No rule to make target '.../base-mk-misc-scratch/test/sql/', needed by 'installcheck'. Stop.
  • With pgxntool#133: the full suite passes, 316/316, 0 skipped.

Merge order

Merge Postgres-Extensions/pgxntool#133 first, then this PR. This is an addition: the new test needs the fixed rule. If this PR merges first, the test fails on every unrelated pgxntool-test PR's CI until the pgxntool PR lands.

🤖 Generated with Claude Code

Add tests for pgxntool commit 1fe6987 (Postgres-Extensions/pgxntool#133):
- The `$(TESTDIR)/sql` directory rule now matches `installcheck`'s
  `$(TESTDIR)/sql/` order-only prerequisite, so `make test` works in a
  project without test/sql/

`base-mk-misc.bats` runs `make -n installcheck` with TESTDIR pointed at a
directory that doesn't exist, and asserts the rules for sql/, expected/ and
results/ all resolve. Overriding TESTDIR reproduces a project without
test/sql/ without changing the shared test environment, which setup.sh has
already given a test/sql/.

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

coderabbitai Bot commented Oct 7, 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: c72d95e7-cf39-479d-bb82-c832888edae0

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
  • Autopilot · 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 added a commit to Postgres-Extensions/pgxntool that referenced this pull request Oct 7, 2026
`make test` failed with `No rule to make target 'test/sql/', needed by
'installcheck'` in a project with no `test/sql/` directory. The rule
that creates the directory was spelled `$(TESTDIR)/sql` while
`installcheck`'s order-only prerequisite is `$(TESTDIR)/sql/`, and make
treats those as different targets. The rule now targets
`$(TESTDIR)/sql/`, matching its `expected/` and `results/` siblings;
`test-build` is fixed too, since it runs `installcheck` recursively.
`setup.sh` normally creates `test/sql/`, which hid this.

**Merge this first**, then Postgres-Extensions/pgxntool-test#100, which
tests it.
@jnasbyupgrade
jnasbyupgrade merged commit 59694b6 into Postgres-Extensions:master Oct 7, 2026
9 checks passed
@jnasbyupgrade
jnasbyupgrade deleted the pre-2.4.0-testsql-dir-rule branch October 7, 2026 21:51
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