Extract DDL and cutover lifecycle tests (#716 subtasks 5+6)#730
Merged
Conversation
43f3a63 to
80953c9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reorganizes the migration test suite by extracting DDL algorithm-selection tests into a new ddl_test.go and moving cutover lifecycle tests into cutover_test.go, converting the extracted tests to use shared test helpers to reduce boilerplate and improve maintainability.
Changes:
- Removed extracted DDL and cutover lifecycle tests from
runner_test.goto significantly reduce file size. - Added new
ddl_test.gocontaining DDL-focused tests converted to helper-based setup/runners. - Appended cutover lifecycle tests to
cutover_test.go, also converted to helper-based setup/runners.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| pkg/migration/runner_test.go | Removes extracted DDL + cutover lifecycle tests, leaving only config/validation-focused tests. |
| pkg/migration/ddl_test.go | New file containing helper-based DDL algorithm selection and statement parsing tests. |
| pkg/migration/cutover_test.go | Adds helper-based cutover lifecycle tests (skip/drop old table, deferred cutover flows). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Move 6 DDL algorithm selection tests into ddl_test.go: - TestForNonInstantBurn - TestIndexVisibility - TestStatementWorkflowStillInstant - TestTrailingSemicolon - TestAlterExtendVarcharE2E - TestMigrationWithSQLCommentsInStatement Move 7 cutover lifecycle tests into cutover_test.go: - TestSkipDropAfterCutoverLongTableName - TestForRemainingTableArtifacts - TestSkipDropAfterCutover - TestDropAfterCutover - TestDeferCutOver - TestDeferCutOverE2E - TestDeferCutOverE2EBinlogAdvance Conversions: - All table setup converted to NewTestTable - All NewRunner calls converted to NewTestRunner/NewTestRunnerFromStatement/NewTestMigration - assert converted to require (fail-fast) - mysql.ParseDSN eliminated from all converted tests - Cutover tests use WithSkipDropAfterCutover/WithDeferCutOver/WithRespectSentinel/WithDBName runner_test.go: 1052 -> 323 lines (-69%) ddl_test.go: 210 lines (new) cutover_test.go: 418 -> 656 lines (+238, appended lifecycle tests) Fixes block#722, fixes block#723 Part of block#716 (test reorganization)
80953c9 to
e92dc5a
Compare
aparajon
approved these changes
Apr 30, 2026
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.
Summary
Move 6 DDL algorithm selection tests into
ddl_test.goand 7 cutover lifecycle tests intocutover_test.go, fully converting them to use test helpers.DDL tests →
ddl_test.go(210 lines, new)TestForNonInstantBurnTestIndexVisibilityTestStatementWorkflowStillInstantTestTrailingSemicolonTestAlterExtendVarcharE2ETestMigrationWithSQLCommentsInStatementCutover lifecycle tests →
cutover_test.go(appended 238 lines)TestSkipDropAfterCutoverLongTableNameTestForRemainingTableArtifactsTestSkipDropAfterCutoverTestDropAfterCutoverTestDeferCutOverTestDeferCutOverE2ETestDeferCutOverE2EBinlogAdvanceConversions applied
NewTestTableNewRunner→NewTestRunner/NewTestRunnerFromStatement/NewTestMigrationassert→require(fail-fast)mysql.ParseDSNeliminated from all converted testsWithSkipDropAfterCutover/WithDeferCutOver/WithRespectSentinel/WithDBNameImpact
runner_test.go: 1,052 → 323 lines (-69%)ddl_test.go: 210 lines (new)cutover_test.go: 418 → 656 lines (+238)runner_test.goFixes #722
Fixes #723
Part of #716