Skip to content

Extract e2e tests into e2e_test.go (#716 subtask 3)#728

Merged
morgo merged 1 commit into
block:mainfrom
morgo:extract-e2e-tests
Apr 30, 2026
Merged

Extract e2e tests into e2e_test.go (#716 subtask 3)#728
morgo merged 1 commit into
block:mainfrom
morgo:extract-e2e-tests

Conversation

@morgo
Copy link
Copy Markdown
Collaborator

@morgo morgo commented Apr 30, 2026

Summary

Moves 16 general E2E tests from runner_test.go into a focused e2e_test.go.

These are happy-path end-to-end tests that exercise the full Runner.Run() lifecycle:

  • TestVarcharNonBinaryComparable
  • TestPartitioningSyntax
  • TestVarbinary
  • TestDataFromBadSqlMode
  • TestOnline (7 sub-scenarios for DDL algorithm detection)
  • TestTableLength
  • TestCreateTableNameLength
  • TestAddUniqueIndexChecksumEnabled
  • TestChangeNonIntPK
  • TestDropColumn
  • TestPartitionedTable
  • TestVarcharE2E
  • TestChunkerPrefetching
  • TestPreRunChecksE2E
  • TestPreventConcurrentRuns
  • TestMigrationCancelledFromTableModification

Conversions

  • All table setup converted to NewTestTable (removes manual DROP TABLE + RunSQL blocks)
  • All NewRunner calls converted to NewTestRunner/NewTestMigration/NewTestRunnerFromStatement
  • Data seeding converted to SeedRows where applicable
  • assert.NoError converted to require.NoError (fail-fast)
  • mysql.ParseDSN eliminated from all converted tests
  • TestOnline restructured with numbered sub-scenarios and comments

Impact

  • runner_test.go: 2,399 → 1,639 lines (-32%)
  • e2e_test.go: 451 lines (new — 42% smaller than a pure move would be)

Fixes #720
Part of #716 (test reorganization)

@morgo morgo force-pushed the extract-e2e-tests branch 3 times, most recently from 714e797 to 2812bcb Compare April 30, 2026 15:19
@morgo morgo requested a review from Copilot April 30, 2026 15:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the migration test-suite reorganization by extracting a set of general “happy-path” end-to-end Runner lifecycle tests out of runner_test.go into a dedicated e2e_test.go, while also refactoring them to use the newer test helpers (NewTestTable, NewTestRunner, NewTestMigration, SeedRows, etc.).

Changes:

  • Moved a set of general E2E tests from pkg/migration/runner_test.go into the new pkg/migration/e2e_test.go.
  • Refactored extracted tests to use the new test helper APIs and fail-fast assertions (require.*).
  • Reduced runner_test.go size by removing the extracted test cases and related unused imports.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/migration/runner_test.go Removes extracted E2E tests and cleans up imports accordingly.
pkg/migration/e2e_test.go Adds a dedicated E2E test file with refactored tests using NewTestTable/NewTestRunner/SeedRows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/migration/e2e_test.go Outdated
Move 16 general E2E tests from runner_test.go into e2e_test.go:
- TestVarcharNonBinaryComparable
- TestPartitioningSyntax
- TestVarbinary
- TestDataFromBadSqlMode
- TestOnline (7 sub-scenarios)
- TestTableLength
- TestCreateTableNameLength
- TestAddUniqueIndexChecksumEnabled
- TestChangeNonIntPK
- TestDropColumn
- TestPartitionedTable
- TestVarcharE2E
- TestChunkerPrefetching
- TestPreRunChecksE2E
- TestPreventConcurrentRuns
- TestMigrationCancelledFromTableModification

Conversions:
- All table setup converted to NewTestTable (removes manual DROP/RunSQL blocks)
- All NewRunner calls converted to NewTestRunner/NewTestMigration
- Data seeding converted to SeedRows where applicable
- assert.NoError converted to require.NoError (fail-fast)
- mysql.ParseDSN eliminated from all converted tests
- TestOnline restructured with numbered sub-scenarios and comments

runner_test.go: 2399 -> 1639 lines (-32%)
e2e_test.go: 451 lines (new, 42% smaller than pure move would be)

Fixes block#720
Part of block#716 (test reorganization)
@morgo morgo force-pushed the extract-e2e-tests branch from 2812bcb to cbbfdaf Compare April 30, 2026 15:29
@morgo morgo merged commit 9bec254 into block:main Apr 30, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3. Extract e2e_test.go from runner_test.go

3 participants