Skip to content

Commit

Permalink
Remove usage of testify
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun Sori committed May 20, 2023
1 parent e29e8ea commit b6c510a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/jackc/pgx/v5 v5.3.1
github.com/microsoft/go-mssqldb v0.21.0
github.com/ory/dockertest/v3 v3.10.0
github.com/stretchr/testify v1.8.2
github.com/testcontainers/testcontainers-go v0.19.0
github.com/vertica/vertica-sql-go v1.3.2
github.com/ziutek/mymysql v1.5.4
Expand All @@ -26,7 +25,6 @@ require (
github.com/containerd/containerd v1.6.19 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/cli v23.0.6+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v23.0.6+incompatible // indirect
Expand Down Expand Up @@ -63,7 +61,6 @@ require (
github.com/paulmach/orb v0.9.2 // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/segmentio/asm v1.2.0 // indirect
Expand Down
5 changes: 0 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,12 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/testcontainers/testcontainers-go v0.19.0 h1:3bmFPuQRgVIQwxZJERyzB8AogmJW3Qzh8iDyfJbPhi8=
github.com/testcontainers/testcontainers-go v0.19.0/go.mod h1:3YsSoxK0rGEUzbGD4gUVt1Nm3GJpCIq94GX+2LSf3d4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
Expand Down
15 changes: 7 additions & 8 deletions tests/clickhouse/clickhouse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/pressly/goose/v3"
"github.com/pressly/goose/v3/internal/check"
"github.com/pressly/goose/v3/internal/testdb"
"github.com/stretchr/testify/require"
)

func TestMain(m *testing.M) {
Expand All @@ -28,12 +27,12 @@ func openClickHouse(t *testing.T) *sql.DB {
t.Helper()

workingDir, err := os.Getwd()
require.NoError(t, err)
check.NoError(t, err)
ctx := context.Background()
// Minimal additional configuration (config.d) to enable cluster mode
replconf := path.Join(workingDir, "clickhouse-replicated.xml")
chContainer, err := testdb.CreateClickHouseContainer(ctx, replconf)
require.NoError(t, err)
check.NoError(t, err)

t.Cleanup(func() {
if err := chContainer.Terminate(ctx); err != nil {
Expand All @@ -46,14 +45,14 @@ func openClickHouse(t *testing.T) *sql.DB {
})

port, err := chContainer.MappedPort(ctx, "9000/tcp")
require.NoError(t, err)
check.NoError(t, err)
host, err := chContainer.Host(ctx)
require.NoError(t, err)
check.NoError(t, err)
endpoint := fmt.Sprintf("clickhouse://%s:%s", host, port.Port())
t.Log(endpoint)

db, err := testdb.OpenClickhouse(endpoint, true)
require.NoError(t, err)
check.NoError(t, err)

return db
}
Expand Down Expand Up @@ -165,12 +164,12 @@ func TestClickHouseOnCluster(t *testing.T) {
err := goose.AttachOptions(map[string]string{
"ON_CLUSTER": "true",
})
require.NoError(t, err)
check.NoError(t, err)

db := openClickHouse(t)

_, err = goose.GetDBVersion(db)
require.NoError(t, err)
check.NoError(t, err)

migrationDir := filepath.Join("testdata", "migrations")
// Collect migrations so we don't have to hard-code the currentVersion
Expand Down

0 comments on commit b6c510a

Please sign in to comment.