Skip to content

Commit

Permalink
chore: terminate container on end
Browse files Browse the repository at this point in the history
This is not relevant for this PR, as Ryuk is responsible for terminating containers after the test session finishes
  • Loading branch information
mdelapenya committed Sep 18, 2024
1 parent 1bb4d92 commit f962d64
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clickhouse/clickhouse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ func getTestConnection(t testing.TB, cfg Config) (*Storage, error) {
if err != nil {
return nil, err
}
t.Cleanup(func() {
if c != nil {
require.NoError(t, c.Terminate(ctx))
}
})

hostPort, err := c.ConnectionHost(ctx)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions couchbase/couchbase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ func newTestStore(t testing.TB) (*Storage, error) {
if err != nil {
return nil, err
}
t.Cleanup(func() {
if c != nil {
require.NoError(t, c.Terminate(ctx))
}
})

conn, err := c.ConnectionString(ctx)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions minio/minio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func newTestStore(t testing.TB) (*Storage, error) {
if err != nil {
return nil, err
}
t.Cleanup(func() {
if c != nil {
require.NoError(t, c.Terminate(ctx))
}
})

conn, err := c.ConnectionString(ctx)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions mongodb/mongodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ func newTestStore(t testing.TB) (*Storage, error) {
if err != nil {
return nil, err
}
t.Cleanup(func() {
if c != nil {
require.NoError(t, c.Terminate(ctx))
}
})

conn, err := c.ConnectionString(ctx)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions mssql/mssql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func newTestStore(t testing.TB) (*Storage, error) {
if err != nil {
return nil, err
}
t.Cleanup(func() {
if c != nil {
require.NoError(t, c.Terminate(ctx))
}
})

conn, err := c.ConnectionString(ctx)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions mysql/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ func mustStartMySQL(t testing.TB) *mysql.MySQLContainer {
mysql.WithDatabase(mysqlDatabase),
)
require.NoError(t, err)
t.Cleanup(func() {
if c != nil {
require.NoError(t, c.Terminate(ctx))
}
})

return c
}
Expand Down
5 changes: 5 additions & 0 deletions postgres/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func newTestStore(t testing.TB) (*Storage, error) {
),
)
require.NoError(t, err)
t.Cleanup(func() {
if c != nil {
require.NoError(t, c.Terminate(ctx))
}
})

conn, err := c.ConnectionString(ctx, "sslmode=disable")
if err != nil {
Expand Down

0 comments on commit f962d64

Please sign in to comment.