Skip to content

Fix upgrade test: build default install SQL from HEAD, not initial commit#2397

Merged
MuhammadTahaNaveed merged 1 commit intoapache:masterfrom
jrgemignani:fix_upgrade_template_regression
Apr 16, 2026
Merged

Fix upgrade test: build default install SQL from HEAD, not initial commit#2397
MuhammadTahaNaveed merged 1 commit intoapache:masterfrom
jrgemignani:fix_upgrade_template_regression

Conversation

@jrgemignani
Copy link
Copy Markdown
Contributor

…mmit

The upgrade test previously built age--.sql from the initial version-bump commit, meaning CREATE EXTENSION installed 'day-one' SQL. This caused all 31 non-upgrade regression tests to run WITHOUT SQL functions added after the version bump (e.g., age_invalidate_graph_cache, age_prepare_pg_upgrade, age_vertex_stats, etc.). These functions were never registered in pg_proc, so features depending on them (like VLE cache invalidation triggers) were silently disabled during testing.

Fix by inverting the upgrade test direction:

Before (installs incomplete SQL, upgrades to complete):
age--1.7.0.sql built from version-bump commit (incomplete)
age--1.7.0_upgrade_test.sql built from HEAD (complete)
age--1.7.0--1.7.0_upgrade_test.sql stamped from template
Test: CREATE EXTENSION age -> data -> ALTER EXTENSION UPDATE TO '1.7.0_upgrade_test'

After (installs complete SQL, upgrades from synthetic initial):
age--1.7.0.sql built from HEAD (complete)
age--1.7.0_initial.sql built from version-bump commit (synthetic)
age--1.7.0_initial--1.7.0.sql stamped from template
Test: CREATE EXTENSION age VERSION '1.7.0_initial' -> data -> ALTER EXTENSION UPDATE TO '1.7.0'

This ensures:

  • All 31 non-upgrade tests run with every SQL function registered
  • The upgrade template is still validated (initial -> current)
  • The test ends at the default version (clean state for drop test)
  • Tarball builds (no git) work identically (cat sql/sql_files)
  • All synthetic files are cleaned up after the test

Makefile changes:

  • age_sql rule: cat current HEAD sql/sql_files (was: git show from commit)
  • New age_init_sql rule: git show from version-bump commit
  • age_upgrade_test_sql: stamps template as INIT->CURR (was CURR->NEXT)
  • EXTRA_CLEAN, _install_upgrade_test_files: updated filenames
  • Removed AGE_NEXT_VER, age_next_sql; added AGE_INIT_VER, age_init_sql

Test SQL changes:

  • Step 3: CREATE EXTENSION age VERSION '' (was: CREATE EXTENSION age)
  • Step 6: ALTER EXTENSION age UPDATE TO default_version (was: LIKE '%_upgrade_test')
  • Step 7: Check installed = default (was: installed <> default)
  • Comments updated throughout to reflect inverted direction

All 32 regression tests pass.

modified: Makefile
modified: regress/expected/age_upgrade.out
modified: regress/sql/age_upgrade.sql

…mmit

The upgrade test previously built age--<CURR>.sql from the initial
version-bump commit, meaning CREATE EXTENSION installed 'day-one'
SQL. This caused all 31 non-upgrade regression tests to run WITHOUT
SQL functions added after the version bump (e.g., age_invalidate_graph_cache,
age_prepare_pg_upgrade, age_vertex_stats, etc.). These functions were
never registered in pg_proc, so features depending on them (like VLE
cache invalidation triggers) were silently disabled during testing.

Fix by inverting the upgrade test direction:

Before (installs incomplete SQL, upgrades to complete):
  age--1.7.0.sql                     built from version-bump commit (incomplete)
  age--1.7.0_upgrade_test.sql        built from HEAD (complete)
  age--1.7.0--1.7.0_upgrade_test.sql stamped from template
  Test: CREATE EXTENSION age -> data -> ALTER EXTENSION UPDATE TO '1.7.0_upgrade_test'

After (installs complete SQL, upgrades from synthetic initial):
  age--1.7.0.sql                     built from HEAD (complete)
  age--1.7.0_initial.sql             built from version-bump commit (synthetic)
  age--1.7.0_initial--1.7.0.sql      stamped from template
  Test: CREATE EXTENSION age VERSION '1.7.0_initial' -> data -> ALTER EXTENSION UPDATE TO '1.7.0'

This ensures:
  - All 31 non-upgrade tests run with every SQL function registered
  - The upgrade template is still validated (initial -> current)
  - The test ends at the default version (clean state for drop test)
  - Tarball builds (no git) work identically (cat sql/sql_files)
  - All synthetic files are cleaned up after the test

Makefile changes:
  - age_sql rule: cat current HEAD sql/sql_files (was: git show from commit)
  - New age_init_sql rule: git show from version-bump commit
  - age_upgrade_test_sql: stamps template as INIT->CURR (was CURR->NEXT)
  - EXTRA_CLEAN, _install_upgrade_test_files: updated filenames
  - Removed AGE_NEXT_VER, age_next_sql; added AGE_INIT_VER, age_init_sql

Test SQL changes:
  - Step 3: CREATE EXTENSION age VERSION '<init>' (was: CREATE EXTENSION age)
  - Step 6: ALTER EXTENSION age UPDATE TO default_version (was: LIKE '%_upgrade_test')
  - Step 7: Check installed = default (was: installed <> default)
  - Comments updated throughout to reflect inverted direction

All 32 regression tests pass.

modified:   Makefile
modified:   regress/expected/age_upgrade.out
modified:   regress/sql/age_upgrade.sql
@jrgemignani jrgemignani changed the title Fix upgrade test: build default install SQL from HEAD, not initial co… Fix upgrade test: build default install SQL from HEAD, not initial commit Apr 16, 2026
Copy link
Copy Markdown
Member

@MuhammadTahaNaveed MuhammadTahaNaveed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified. Fixes the new functions missing in age-x.x.x.sql file.

@MuhammadTahaNaveed MuhammadTahaNaveed merged commit f1a9b1d into apache:master Apr 16, 2026
6 checks passed
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.

2 participants