Skip to content

migration: Simplify idempotency tests

Administrator requested to merge ef/fix-idempotency-test into main

Created by: efritz

In #33543, we discovered that the idempotency test is not well-formed if there is a significant gap between adding a new migration and the state of main. This can happen with stale branches.

Failures on this PR happened because we were too strict about what we wanted from the idempotency test. We upgrade down to the parent version, but that could lead to running too many down migrations for the test conditions. This works in real-life scenarios, but we just got lucky in testing environments so far.

We now specifically run all migration queries directly instead of relying on the migration runner to put the schema in the correct state for these assertions. I've done the same thing in the up direction for consistency.

Test plan

Tested locally.

Merge request reports

Loading