Skip to content

Use manifest-driven SQL test ordering and manifest coverage guard#54

Merged
seanwevans merged 1 commit into
mainfrom
codex/refactor-test-discovery-in-makefile
May 20, 2026
Merged

Use manifest-driven SQL test ordering and manifest coverage guard#54
seanwevans merged 1 commit into
mainfrom
codex/refactor-test-discovery-in-makefile

Conversation

@seanwevans
Copy link
Copy Markdown
Owner

Motivation

  • Replace the fragile, hand-maintained TESTS := ... list in makefile with a single authoritative source of truth so test order is deterministic and easier to update.
  • Ensure contributors cannot accidentally add test/sql/*_test.sql files without registering them in the execution order.

Description

  • Add test/sql/manifest.txt as the authoritative, ordered list of tests and include bootstrap entries like test/sql/init.sql.
  • Change makefile to read TESTS from TEST_MANIFEST := test/sql/manifest.txt using sed and preserve ordered execution by feeding that list to pg_prove.
  • Add a check-test-manifest make target that fails when any discovered test/sql/*_test.sql file is missing from the manifest, using a comm/find/sed check, and make test depend on this guard.
  • Update README.md Testing section to document the manifest-driven mechanism and make test invocation, and update CONTRIBUTING.md with guidance to add new tests by adding the file and registering its path in test/sql/manifest.txt and running make check-test-manifest.

Testing

  • Attempted make check-test-manifest and make -n test but the local environment lacks the PGXS include path (error: /usr/lib/postgresql/16/lib/pgxs/src/makefiles/pgxs.mk) so the Makefile-based run could not complete.
  • Validated the coverage guard logic externally with the shell check comm -23 <(find test/sql -maxdepth 1 -type f -name '*_test.sql' | sort) <(sed -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*$$/d' test/sql/manifest.txt | sort), which initially reported one missing entry.
  • Added the missing test/sql/search_path_qualification_test.sql to test/sql/manifest.txt and re-ran the same comm/find/sed validation, which returned no missing files (guard logic passes).

Codex Task

@seanwevans seanwevans merged commit c26d492 into main May 20, 2026
1 check failed
@seanwevans seanwevans deleted the codex/refactor-test-discovery-in-makefile branch May 20, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant