File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,12 @@ type SafeMigrations struct {
4848 MovePKToCQOnly bool
4949}
5050
51+ // Migrations defines which migrations should be skipped completely
52+ type Migrations struct {
53+ RemoveUniqueConstraint bool
54+ MovePKToCQOnly bool
55+ }
56+
5157type WriterTestSuiteTests struct {
5258 // SkipUpsert skips testing with message.Insert and Upsert=true.
5359 // Usually when a destination is not supporting primary keys
@@ -68,6 +74,8 @@ type WriterTestSuiteTests struct {
6874 // SafeMigrations defines which tests should work with force migration
6975 // and which should pass with safe migration
7076 SafeMigrations SafeMigrations
77+
78+ SkipSpecificMigrations Migrations
7179}
7280
7381type NewPluginFunc func () * Plugin
Original file line number Diff line number Diff line change @@ -250,6 +250,9 @@ func (s *WriterTestSuite) testMigrate(
250250 })
251251
252252 t .Run ("remove_unique_constraint_only" + suffix , func (t * testing.T ) {
253+ if s .tests .SkipSpecificMigrations .RemoveUniqueConstraint {
254+ t .Skip ("skipping test completely: remove_unique_constraint_only" )
255+ }
253256 if ! forceMigrate && ! s .tests .SafeMigrations .RemoveUniqueConstraint {
254257 t .Skip ("skipping test: remove_unique_constraint_only" )
255258 }
@@ -277,6 +280,9 @@ func (s *WriterTestSuite) testMigrate(
277280 })
278281
279282 t .Run ("move_to_cq_id_only" + suffix , func (t * testing.T ) {
283+ if s .tests .SkipSpecificMigrations .MovePKToCQOnly {
284+ t .Skip ("skipping test completely: move_to_cq_id_only" )
285+ }
280286 if ! forceMigrate && ! s .tests .SafeMigrations .MovePKToCQOnly {
281287 t .Skip ("skipping test: move_to_cq_id_only" )
282288 }
@@ -303,8 +309,11 @@ func (s *WriterTestSuite) testMigrate(
303309 }
304310 })
305311 t .Run ("move_to_cq_id_only_adding_pkc" + suffix , func (t * testing.T ) {
312+ if s .tests .SkipSpecificMigrations .MovePKToCQOnly {
313+ t .Skip ("skipping test completely: move_to_cq_id_only_adding_pkc" )
314+ }
306315 if ! forceMigrate && ! s .tests .SafeMigrations .MovePKToCQOnly {
307- t .Skip ("skipping test: move_to_cq_id_only_adding_pk " )
316+ t .Skip ("skipping test: move_to_cq_id_only_adding_pkc " )
308317 }
309318 tableName := "cq_move_to_cq_id_only_adding_pkc" + suffix + "_" + tableUUIDSuffix ()
310319 source := & schema.Table {
You can’t perform that action at this time.
0 commit comments