@@ -85,6 +85,32 @@ func mustRun(t *testing.T, d database.Driver, statements []string) {
85
85
}
86
86
87
87
func Test (t * testing.T ) {
88
+ t .Run ("test" , test )
89
+ t .Run ("testMigrate" , testMigrate )
90
+ t .Run ("testMultipleStatements" , testMultipleStatements )
91
+ t .Run ("testMultipleStatementsInMultiStatementMode" , testMultipleStatementsInMultiStatementMode )
92
+ t .Run ("testErrorParsing" , testErrorParsing )
93
+ t .Run ("testFilterCustomQuery" , testFilterCustomQuery )
94
+ t .Run ("testWithSchema" , testWithSchema )
95
+ t .Run ("testMigrationTableOption" , testMigrationTableOption )
96
+ t .Run ("testFailToCreateTableWithoutPermissions" , testFailToCreateTableWithoutPermissions )
97
+ t .Run ("testCheckBeforeCreateTable" , testCheckBeforeCreateTable )
98
+ t .Run ("testParallelSchema" , testParallelSchema )
99
+ t .Run ("testPostgresLock" , testPostgresLock )
100
+ t .Run ("testWithInstanceConcurrent" , testWithInstanceConcurrent )
101
+ t .Run ("testWithConnection" , testWithConnection )
102
+
103
+ t .Cleanup (func () {
104
+ for _ , spec := range specs {
105
+ t .Log ("Cleaning up " , spec .ImageName )
106
+ if err := spec .Cleanup (); err != nil {
107
+ t .Error ("Error removing " , spec .ImageName , "error:" , err )
108
+ }
109
+ }
110
+ })
111
+ }
112
+
113
+ func test (t * testing.T ) {
88
114
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
89
115
ip , port , err := c .FirstPort ()
90
116
if err != nil {
@@ -106,7 +132,7 @@ func Test(t *testing.T) {
106
132
})
107
133
}
108
134
109
- func TestMigrate (t * testing.T ) {
135
+ func testMigrate (t * testing.T ) {
110
136
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
111
137
ip , port , err := c .FirstPort ()
112
138
if err != nil {
@@ -132,7 +158,7 @@ func TestMigrate(t *testing.T) {
132
158
})
133
159
}
134
160
135
- func TestMultipleStatements (t * testing.T ) {
161
+ func testMultipleStatements (t * testing.T ) {
136
162
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
137
163
ip , port , err := c .FirstPort ()
138
164
if err != nil {
@@ -165,7 +191,7 @@ func TestMultipleStatements(t *testing.T) {
165
191
})
166
192
}
167
193
168
- func TestMultipleStatementsInMultiStatementMode (t * testing.T ) {
194
+ func testMultipleStatementsInMultiStatementMode (t * testing.T ) {
169
195
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
170
196
ip , port , err := c .FirstPort ()
171
197
if err != nil {
@@ -198,7 +224,7 @@ func TestMultipleStatementsInMultiStatementMode(t *testing.T) {
198
224
})
199
225
}
200
226
201
- func TestErrorParsing (t * testing.T ) {
227
+ func testErrorParsing (t * testing.T ) {
202
228
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
203
229
ip , port , err := c .FirstPort ()
204
230
if err != nil {
@@ -227,7 +253,7 @@ func TestErrorParsing(t *testing.T) {
227
253
})
228
254
}
229
255
230
- func TestFilterCustomQuery (t * testing.T ) {
256
+ func testFilterCustomQuery (t * testing.T ) {
231
257
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
232
258
ip , port , err := c .FirstPort ()
233
259
if err != nil {
@@ -249,7 +275,7 @@ func TestFilterCustomQuery(t *testing.T) {
249
275
})
250
276
}
251
277
252
- func TestWithSchema (t * testing.T ) {
278
+ func testWithSchema (t * testing.T ) {
253
279
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
254
280
ip , port , err := c .FirstPort ()
255
281
if err != nil {
@@ -319,7 +345,7 @@ func TestWithSchema(t *testing.T) {
319
345
})
320
346
}
321
347
322
- func TestMigrationTableOption (t * testing.T ) {
348
+ func testMigrationTableOption (t * testing.T ) {
323
349
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
324
350
ip , port , err := c .FirstPort ()
325
351
if err != nil {
@@ -387,7 +413,7 @@ func TestMigrationTableOption(t *testing.T) {
387
413
})
388
414
}
389
415
390
- func TestFailToCreateTableWithoutPermissions (t * testing.T ) {
416
+ func testFailToCreateTableWithoutPermissions (t * testing.T ) {
391
417
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
392
418
ip , port , err := c .FirstPort ()
393
419
if err != nil {
@@ -457,7 +483,7 @@ func TestFailToCreateTableWithoutPermissions(t *testing.T) {
457
483
})
458
484
}
459
485
460
- func TestCheckBeforeCreateTable (t * testing.T ) {
486
+ func testCheckBeforeCreateTable (t * testing.T ) {
461
487
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
462
488
ip , port , err := c .FirstPort ()
463
489
if err != nil {
@@ -534,7 +560,7 @@ func TestCheckBeforeCreateTable(t *testing.T) {
534
560
})
535
561
}
536
562
537
- func TestParallelSchema (t * testing.T ) {
563
+ func testParallelSchema (t * testing.T ) {
538
564
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
539
565
ip , port , err := c .FirstPort ()
540
566
if err != nil {
@@ -602,7 +628,7 @@ func TestParallelSchema(t *testing.T) {
602
628
})
603
629
}
604
630
605
- func TestPostgres_Lock (t * testing.T ) {
631
+ func testPostgresLock (t * testing.T ) {
606
632
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
607
633
ip , port , err := c .FirstPort ()
608
634
if err != nil {
@@ -642,7 +668,7 @@ func TestPostgres_Lock(t *testing.T) {
642
668
})
643
669
}
644
670
645
- func TestWithInstance_Concurrent (t * testing.T ) {
671
+ func testWithInstanceConcurrent (t * testing.T ) {
646
672
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
647
673
ip , port , err := c .FirstPort ()
648
674
if err != nil {
@@ -685,7 +711,7 @@ func TestWithInstance_Concurrent(t *testing.T) {
685
711
})
686
712
}
687
713
688
- func TestWithConnection (t * testing.T ) {
714
+ func testWithConnection (t * testing.T ) {
689
715
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
690
716
ip , port , err := c .FirstPort ()
691
717
if err != nil {
0 commit comments