Skip to content

Add test coverage for parallel-build corruption, stale-expected check, base.mk fixes#31

Open
jnasbyupgrade wants to merge 3 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:fix-buildsystem-batch
Open

Add test coverage for parallel-build corruption, stale-expected check, base.mk fixes#31
jnasbyupgrade wants to merge 3 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:fix-buildsystem-batch

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

Related pgxntool PR: Postgres-Extensions/pgxntool#61

New BATS coverage in test/standard/:

  • versioned-sql-race.bats (Fix results ordering, control file whitespace, ENABLE_* overrides #19): races two genuinely concurrent make all invocations against the same versioned-SQL target across 5 iterations, asserting the resulting file is never doubled. Verified by hand first that the old two-line recipe reproduces doubling (~1/3 of trials); the fixed single-redirect recipe never doubled across 15+ manual trials.
  • check-stale-expected.bats (Make branch alignment check bidirectional #14): orphaned-file failure (both the standalone target and via make test before PostgreSQL is needed), the pg_regress alternate-output-file (_N.out) false-positive exemption plus a case proving the exemption doesn't over-apply when the alternate's own base .sql is also missing, and the same coverage for the test/build/test/build/expected pair.
  • base-mk-fixes.bats (Add tests for test-install, test-build, verify-results #7, #50, #53): EXTRA_CLEAN targets the real test/results/ directory and make clean actually removes it; PGXN_REMOTE defaults to origin and is overridable for both tag and rmtag; a throwaway Makefile that includes pgxntool/base.mk twice (directly and via an intermediate module) parses with no overriding-recipe warnings.

#28 (variable rename) deliberately has no new test — pure mechanical rename, no behavior change, already exercised by the existing suite's DATA/build-output coverage.

Full suite passes 228/228, 0 skips.

…ion, stale-expected check, base.mk fixes):

- Fix versioned SQL file generation race that doubled file content
- Add check-stale-expected to catch orphaned test/expected/*.out files
- Fix EXTRA_CLEAN target, add PGXN_REMOTE override, add base.mk include guard

New BATS coverage in test/standard/:
- versioned-sql-race.bats: races two concurrent `make all` invocations
  against the same versioned-SQL target across 5 iterations, asserting
  the file is never doubled (issue Postgres-Extensions#19)
- check-stale-expected.bats: orphaned-file failure, the pg_regress
  alternate-output-file (_N.out) false-positive exemption plus a case
  proving it doesn't over-exempt, and the test/build/expected pair
  (issue Postgres-Extensions#14)
- base-mk-fixes.bats: EXTRA_CLEAN targets the real test/results/ dir,
  PGXN_REMOTE default and override for tag/rmtag, and a double-include
  Makefile confirming base.mk's new guard is warning-free (issues Postgres-Extensions#7,
  #50, #53)

Issue Postgres-Extensions#28 (variable rename) deliberately has no new test -- pure
mechanical rename, no behavior change, already covered by the existing
suite's DATA/build-output coverage.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 26, 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: Pro Plus

Run ID: 20a68e75-49c0-4c5f-87a3-16ae23a41e8d

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 2 commits July 26, 2026 14:34
…s a script, ordering fix, variable rename):

- check-stale-expected logic moved to check-stale-expected.sh
- Now depends on installcheck directly so it runs after pg_regress
- EXTENSION_VERSION_FILES renamed to EXTENSION__CURRENT_VERSION__FILES

- Replace the old "fails fast, before install/installcheck" test with
  one that verifies the new ordering via a make -n test dry-run
  (pg_regress's invocation must appear before check-stale-expected.sh),
  plus a test proving make test only fails on a stale file after
  pg_regress has produced real results (test/results/*.out)
- Add pgxntool/check-stale-expected.sh to the dist file manifest

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…ipt move, file-type check, enable toggles)

- check-stale-expected.sh moved to test/bin/check-stale-expected.sh
- expected/ now also validated for non-*.out files (distinct error/exit code)
- PGXNTOOL_ENABLE_CHECK_STALE_EXPECTED and PGXNTOOL_CHECK_EXPECTED_FILE_TYPES toggles added

- Update dist-expected-files.txt for the new script path/directory
- Add coverage for the non-.out file check (direct script invocation,
  since make's own exit status masks the child's real code) and for
  PGXNTOOL_CHECK_EXPECTED_FILE_TYPES=no
- Fix the ordering test to exclude test-build's own pg_regress
  invocation when locating the real installcheck one, since the
  TEST_DEPS reordering in this commit changed their relative dry-run
  output order (no ordering relationship was ever guaranteed between
  them -- only the explicit check-stale-expected: installcheck edge
  matters)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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