Skip to content

Improve extension upgrade regression test (addendum to #2364)#2377

Open
jrgemignani wants to merge 1 commit intoapache:masterfrom
jrgemignani:update_upgrade_regression_tests
Open

Improve extension upgrade regression test (addendum to #2364)#2377
jrgemignani wants to merge 1 commit intoapache:masterfrom
jrgemignani:update_upgrade_regression_tests

Conversation

@jrgemignani
Copy link
Copy Markdown
Contributor

Note: This PR was created with AI tools and a human.

This is an addendum to PR #2364 with three improvements.

Makefile:

  • Replace awk-based synthetic version (minor+1) with an _upgrade_test suffix (e.g., 1.7.0 -> 1.7.0_upgrade_test). The awk approach produced numeric versions like 1.8.0 that could collide with real future upgrade scripts, and the ::int[] cast in the SQL version lookup fails on non-numeric version strings. The _upgrade_test suffix avoids both issues and is unambiguously synthetic.
  • Extend the generated cleanup script to also remove repo-root copies of the synthetic files and to self-delete, preventing stale artifacts from accumulating across repeated test runs.

Regression test (regress/sql/age_upgrade.sql):

  • Simplify version lookup to directly select the _upgrade_test version via LIKE '%_upgrade_test' instead of picking the highest non-default version with string_to_array(version, '.')::int[] DESC. The old approach would fail with a cast error on the _upgrade_test suffix and was unnecessarily indirect — the test knows exactly what synthetic version the Makefile installed.

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

Note: This PR was created with AI tools and a human.

This is an addendum to PR apache#2364 with three improvements.

Makefile:
- Replace awk-based synthetic version (minor+1) with an _upgrade_test
  suffix (e.g., 1.7.0 -> 1.7.0_upgrade_test). The awk approach produced
  numeric versions like 1.8.0 that could collide with real future upgrade
  scripts, and the ::int[] cast in the SQL version lookup fails on
  non-numeric version strings. The _upgrade_test suffix avoids both
  issues and is unambiguously synthetic.
- Extend the generated cleanup script to also remove repo-root copies
  of the synthetic files and to self-delete, preventing stale artifacts
  from accumulating across repeated test runs.

Regression test (regress/sql/age_upgrade.sql):
- Simplify version lookup to directly select the _upgrade_test version
  via LIKE '%_upgrade_test' instead of picking the highest non-default
  version with string_to_array(version, '.')::int[] DESC. The old
  approach would fail with a cast error on the _upgrade_test suffix and
  was unnecessarily indirect — the test knows exactly what synthetic
  version the Makefile installed.

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

Co-authored-by: Claude <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refines the extension upgrade regression test infrastructure introduced in #2364 by switching to a clearly synthetic “next” version suffix and updating the regression test’s version selection and cleanup behavior.

Changes:

  • Change synthetic “next” extension versioning from minor+1 to a _upgrade_test suffix to avoid collisions with real future versions.
  • Update the upgrade regression test to select the synthetic version via pattern matching instead of numeric array casting.
  • Extend the generated cleanup script to remove additional synthetic artifacts and self-delete.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
Makefile Generates _upgrade_test synthetic version and expands cleanup script to remove more artifacts.
regress/sql/age_upgrade.sql Updates lookup logic for selecting the synthetic upgrade target version.
regress/expected/age_upgrade.out Adjusts expected output to match the updated version-lookup query.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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