Skip to content

test(purchase): NeverStartedLegacyRampsBecomeNew skips 000127 once a later migration exists #1059

Closed

Description

@IAmJSD

TestMigration_NeverStartedLegacyRampsBecomeNew (internal/purchase/plan_step_ledger_migration_integration_test.go, from #905) breaks as soon as any migration newer than 000127 exists.

stagedMigrations copies every migration except 000127_never_started_legacy_ramps_to_new and runs them, then adds 000127 and runs the migrator again. When a later migration is present (#1020 adds 000128, #1022 adds 000129), the first run already takes the schema past 127. golang-migrate never applies a version below the current one, so the second run is a no-op and 000127 never runs:

plan_step_ledger_migration_integration_test.go:91:
    expected: "new"
    actual  : "legacy"
    Messages: never started, no executions

This is the Integration Tests failure on #1022 (#1022). It will hit #1020 and every later migration too.

Fix: stage only the migrations numbered below 000127 for the first run, and add 000127 together with everything after it for the second run. The test then keeps exercising "upgrade from just before 000127" however many migrations follow.

Activity

  1. self-assigned this
    on Oct 17, 2026
  2. IAmJSD commented on Oct 17, 2026

    @IAmJSD
    CollaboratorAuthor

    Claiming: working on this

  3. added a commit that references this issue on Oct 17, 2026
    22384a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions