Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-wright committed May 27, 2024
1 parent f4bde45 commit 75a64d9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deploy/Test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ FROM scratch
COPY tests /tests

ENTRYPOINT [ "/tests" ]
CMD [ "-test.run", "Integration", "-test.v" ]
CMD [ "-test.run", "Integration" ]
7 changes: 7 additions & 0 deletions tests/nats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/benjamin-wright/db-operator/internal/dbs/nats/k8s"
"github.com/benjamin-wright/db-operator/internal/dbs/nats/k8s/clients"
"github.com/benjamin-wright/db-operator/internal/dbs/nats/k8s/clusters"
"github.com/rs/zerolog"
"github.com/stretchr/testify/assert"
)

Expand All @@ -16,6 +17,12 @@ func TestNatsIntegration(t *testing.T) {
t.Skip("skipping integration test")
}

if testing.Verbose() {
zerolog.SetGlobalLevel(zerolog.DebugLevel)
} else {
zerolog.SetGlobalLevel(zerolog.Disabled)
}

namespace := os.Getenv("NAMESPACE")

client, err := k8s.New()
Expand Down
13 changes: 12 additions & 1 deletion tests/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ func TestPostgresIntegration(t *testing.T) {
mustPass(t, err)

mustPass(t, mig.Init())
mustPass(t, mig.Run([]migrations.Migration{
{
Index: 1,
Query: `
CREATE TABLE test_table (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL
)
`,
},
}))

user := waitForResult(t, func() (secrets.Resource, error) {
return client.Secrets().Get(context.Background(), "other-secret-"+seed, namespace)
Expand All @@ -123,6 +134,6 @@ func TestPostgresIntegration(t *testing.T) {

tables := pg.GetTableNames(t)

expected := []string{"migrations"}
expected := []string{"migrations", "test_table"}
assert.Equal(t, expected, tables)
}
7 changes: 7 additions & 0 deletions tests/redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/benjamin-wright/db-operator/internal/dbs/redis/k8s"
"github.com/benjamin-wright/db-operator/internal/dbs/redis/k8s/clients"
"github.com/benjamin-wright/db-operator/internal/dbs/redis/k8s/clusters"
"github.com/rs/zerolog"
"github.com/stretchr/testify/assert"
)

Expand All @@ -16,6 +17,12 @@ func TestRedisIntegration(t *testing.T) {
t.Skip("skipping integration test")
}

if testing.Verbose() {
zerolog.SetGlobalLevel(zerolog.DebugLevel)
} else {
zerolog.SetGlobalLevel(zerolog.Disabled)
}

namespace := os.Getenv("NAMESPACE")

client, err := k8s.New()
Expand Down

0 comments on commit 75a64d9

Please sign in to comment.