Improve extension upgrade regression test (addendum to #2364)#2377
Open
jrgemignani wants to merge 1 commit intoapache:masterfrom
Open
Improve extension upgrade regression test (addendum to #2364)#2377jrgemignani wants to merge 1 commit intoapache:masterfrom
jrgemignani wants to merge 1 commit intoapache:masterfrom
Conversation
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>
There was a problem hiding this comment.
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+1to a_upgrade_testsuffix 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note: This PR was created with AI tools and a human.
This is an addendum to PR #2364 with three improvements.
Makefile:
Regression test (regress/sql/age_upgrade.sql):
modified: Makefile
modified: regress/expected/age_upgrade.out
modified: regress/sql/age_upgrade.sql