[backport -> release/3.7.x] tests(ci): fix migration test failed to run when updating migration files for an unreleased version #13141
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.
Automated backport to
release/3.7.x
, triggered by a label in #13134.Original description
Summary
This PR fixes an issue that migration tests will fail when the migration files for the next unreleased version get updated.
It has created a PR base branch
next/3.4.x.x
. Add migration scripts to the existing script file, such askong/enterprise_edition/db/migrations/enterprise/021_3435_to_3436.lua
. It will be ignored when executingkong migrations up
.case 1: upgrade next/2.8.x.x to the current PR of the next/3.4.x.x. the migration
021_3435_to_3436.lua
is always new.The upgrade_tests are work well.
case 2: Upgrade
next/3.4.x.x
to the current PR ofnext/3.4.x.x
. When starting thenext/3.4.x.x
container, the migration script021_3435_to_3436.lua
will be bootstrapped for the first time. Then, upgrade to this PR. The second time usingkong migrations up
to bootstrap the script will not execute the migration script021_3435_to_3436.lua
.There is an example. https://github.com/Kong/kong-ee/actions/runs/9310936847/job/25629308613
Checklist
CHANGELOG/unreleased/kong
or addingskip-changelog
label on PR if unnecessary. README.md