Add copier test, upgrade testcontainers by meiji163 · Pull Request #1567 · github/gh-ost

Pull Request Overview

This PR adds a new copier integration test for the Migrator component, standardizes and refactors existing tests to use shared test utilities, and upgrades Testcontainers (and other dependencies) to v0.37.0.

  • Introduce getTest* helpers and newTestMigrationContext in test_utils.go
  • Refactor streamer, migrator, and applier tests to use the MySQL module and shared helpers
  • Add TestCopierIntPK to validate the copier logic and bump testcontainers-go to v0.37.0

Reviewed Changes

Copilot reviewed 5 out of 473 changed files in this pull request and generated no comments.

Show a summary per file
File Description
go/logic/test_utils.go Add constants and helper functions for DB/table names and connection contexts
go/logic/streamer_test.go Refactor to use mysql.Run, shared utils, and table helpers
go/logic/migrator_test.go Rename tests, inject newTestMigrationContext, add TestCopierIntPK
go/logic/applier_test.go Refactor to use shared utils for container setup and teardown
go.mod Upgrade github.com/testcontainers/testcontainers-go and related modules to v0.37.0
Comments suppressed due to low confidence (2)

go/logic/migrator_test.go:435

  • The database name in the SHOW TABLES query is still hardcoded to test. Use testMysqlDatabase instead of the literal test to stay consistent with the helper constants.

go/logic/migrator_test.go:397

  • Using range directly on an int64 (numRows) is invalid in Go and will not compile. Change to an indexed loop, e.g. for i := int64(0); i < numRows; i++ {}.