Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes from INDATA-152 to INDATA-152-run-server
Overview
This document analyzes only the changes made in the
INDATA-152-run-serverbranch compared to theINDATA-152branch. These changes focus on aligning the test infrastructure more closely with production Ansible configuration patterns and improving transaction handling.Changes: 66 files changed, 1,388 insertions(+), 17,222 deletions(-)
The massive reduction in lines (-15,834 net) is primarily due to changes in expected output files where tests now create and rollback extensions instead of showing permanent installations.
Core Philosophy Change
Before (INDATA-152)
prime.sqlAfter (INDATA-152-run-server)
BEGIN/ROLLBACKtransactionsprime-production.sqlWhy: This matches how production users work—they start with default extensions and create additional ones as needed within their own transactions.
1. Configuration Directory Handling (
run-server.sh.in)Before
After
Why:
POSTGRESQL_CONFIG_DIRinstead of multiple file paths2. Reserved Roles Toggle During Migrations
New Feature
Why:
supautils.reserved_rolesblocks role creation for security3. After-Create Script Execution
New Feature
Why:
pgmqis not in supautilsprivileged_extensionslist4. Production Priming (
prime-production.sql)New File (replaces
prime.sql)Why:
5. Transaction-Wrapped Tests
Before (INDATA-152)
After (INDATA-152-run-server)
Applied to: All 40+ test files
Why:
6. Savepoint Error Handling
pgmq.sql
Before
After
Why:
7. Extension Schema Enforcement
Non-Relocatable Extensions Fixed
pg_tle
pg_surgery
Why:
pg_tle→pgtleschema (enforced by extension itself)pg_surgery→pg_catalogschema (standard location)8. Large Test Refactoring (ext_interface tests)
Before (INDATA-152)
After (INDATA-152-run-server)
Applied to:
z_15_ext_interface.sqlz_17_ext_interface.sqlz_orioledb-17_ext_interface.sqlWhy:
9. Build System Simplification
lib.nix
Before
After
Why:
10. Test Harness Changes
checks.nix
Before
After
Why:
prime-production.sqlwith minimal production defaults11. Migration Test Fixes
migrations/tests/extensions/01-postgis.sql
Before
After
Why:
postgis_tiger_geocoderdepends onaddress_standardizerSummary of Benefits
Production Alignment
✅ Tests use same conf.d structure as Ansible
✅ Tests create extensions same way as users
✅ Tests validate schema enforcement
✅ Tests run after-create scripts same as production
Test Quality
✅ Transaction isolation prevents test interference
✅ Savepoint handling allows proper error testing
✅ No "transaction is aborted" errors
✅ Each test is self-contained and independent
Maintainability
✅ Simpler build system (directory copy vs. individual files)
✅ Fewer configuration variables
✅ Clear test boundaries (BEGIN/ROLLBACK)
✅ Expected output files are smaller (no permanent extension installations)
Development Experience
✅ Faster test startup (9 default extensions vs. 80+)
✅ Easier to understand test failures
✅ Tests catch production issues earlier
✅ Configuration changes automatically picked up (directory-based)
File Change Breakdown
Total: 66 files, net reduction of ~15,834 lines (primarily in expected output files)
Migration Guide
For Test Writers
Old pattern:
New pattern:
For Non-Relocatable Extensions
Always specify the schema:
create extension if not exists pg_tle with schema pgtle; create extension if not exists pg_surgery with schema pg_catalog; create extension if not exists pgsodium; -- uses default 'pgsodium' schemaFor Error Testing
Use savepoints:
Conclusion
The changes from INDATA-152 to INDATA-152-run-server represent a fundamental shift in test philosophy: tests now simulate the production user experience rather than running against a pre-configured database. This improves test accuracy, catches production issues earlier, and makes the test suite more maintainable while reducing overall code size.