@@ -85,6 +85,32 @@ func mustRun(t *testing.T, d database.Driver, statements []string) {
8585}
8686
8787func 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 ) {
88114 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
89115 ip , port , err := c .FirstPort ()
90116 if err != nil {
@@ -106,7 +132,7 @@ func Test(t *testing.T) {
106132 })
107133}
108134
109- func TestMigrate (t * testing.T ) {
135+ func testMigrate (t * testing.T ) {
110136 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
111137 ip , port , err := c .FirstPort ()
112138 if err != nil {
@@ -132,7 +158,7 @@ func TestMigrate(t *testing.T) {
132158 })
133159}
134160
135- func TestMultipleStatements (t * testing.T ) {
161+ func testMultipleStatements (t * testing.T ) {
136162 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
137163 ip , port , err := c .FirstPort ()
138164 if err != nil {
@@ -165,7 +191,7 @@ func TestMultipleStatements(t *testing.T) {
165191 })
166192}
167193
168- func TestMultipleStatementsInMultiStatementMode (t * testing.T ) {
194+ func testMultipleStatementsInMultiStatementMode (t * testing.T ) {
169195 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
170196 ip , port , err := c .FirstPort ()
171197 if err != nil {
@@ -198,7 +224,7 @@ func TestMultipleStatementsInMultiStatementMode(t *testing.T) {
198224 })
199225}
200226
201- func TestErrorParsing (t * testing.T ) {
227+ func testErrorParsing (t * testing.T ) {
202228 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
203229 ip , port , err := c .FirstPort ()
204230 if err != nil {
@@ -227,7 +253,7 @@ func TestErrorParsing(t *testing.T) {
227253 })
228254}
229255
230- func TestFilterCustomQuery (t * testing.T ) {
256+ func testFilterCustomQuery (t * testing.T ) {
231257 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
232258 ip , port , err := c .FirstPort ()
233259 if err != nil {
@@ -249,7 +275,7 @@ func TestFilterCustomQuery(t *testing.T) {
249275 })
250276}
251277
252- func TestWithSchema (t * testing.T ) {
278+ func testWithSchema (t * testing.T ) {
253279 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
254280 ip , port , err := c .FirstPort ()
255281 if err != nil {
@@ -319,7 +345,7 @@ func TestWithSchema(t *testing.T) {
319345 })
320346}
321347
322- func TestMigrationTableOption (t * testing.T ) {
348+ func testMigrationTableOption (t * testing.T ) {
323349 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
324350 ip , port , err := c .FirstPort ()
325351 if err != nil {
@@ -387,7 +413,7 @@ func TestMigrationTableOption(t *testing.T) {
387413 })
388414}
389415
390- func TestFailToCreateTableWithoutPermissions (t * testing.T ) {
416+ func testFailToCreateTableWithoutPermissions (t * testing.T ) {
391417 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
392418 ip , port , err := c .FirstPort ()
393419 if err != nil {
@@ -457,7 +483,7 @@ func TestFailToCreateTableWithoutPermissions(t *testing.T) {
457483 })
458484}
459485
460- func TestCheckBeforeCreateTable (t * testing.T ) {
486+ func testCheckBeforeCreateTable (t * testing.T ) {
461487 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
462488 ip , port , err := c .FirstPort ()
463489 if err != nil {
@@ -534,7 +560,7 @@ func TestCheckBeforeCreateTable(t *testing.T) {
534560 })
535561}
536562
537- func TestParallelSchema (t * testing.T ) {
563+ func testParallelSchema (t * testing.T ) {
538564 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
539565 ip , port , err := c .FirstPort ()
540566 if err != nil {
@@ -602,7 +628,7 @@ func TestParallelSchema(t *testing.T) {
602628 })
603629}
604630
605- func TestPostgres_Lock (t * testing.T ) {
631+ func testPostgresLock (t * testing.T ) {
606632 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
607633 ip , port , err := c .FirstPort ()
608634 if err != nil {
@@ -642,7 +668,7 @@ func TestPostgres_Lock(t *testing.T) {
642668 })
643669}
644670
645- func TestWithInstance_Concurrent (t * testing.T ) {
671+ func testWithInstanceConcurrent (t * testing.T ) {
646672 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
647673 ip , port , err := c .FirstPort ()
648674 if err != nil {
@@ -685,7 +711,7 @@ func TestWithInstance_Concurrent(t *testing.T) {
685711 })
686712}
687713
688- func TestWithConnection (t * testing.T ) {
714+ func testWithConnection (t * testing.T ) {
689715 dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
690716 ip , port , err := c .FirstPort ()
691717 if err != nil {
0 commit comments