Skip to content

Commit

Permalink
postgres: remove KeyStore implementation and tests
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Jul 15, 2021
1 parent fee8bc5 commit 0ca77ce
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 349 deletions.
2 changes: 1 addition & 1 deletion notifier/postgres/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestE2E(t *testing.T) {
},
}
ctx := context.Background()
db, store, _, teardown := TestStore(ctx, t)
db, store, teardown := TestStore(ctx, t)
defer teardown()
e := e2e{
notificaitonID: notificationID,
Expand Down
185 changes: 0 additions & 185 deletions notifier/postgres/keystore.go

This file was deleted.

158 changes: 0 additions & 158 deletions notifier/postgres/keystore_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion notifier/postgres/notification_pagination_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestNotePagination(t *testing.T) {
t.Parallel()
ctx := context.Background()
ctx = zlog.Test(ctx, t)
_, store, _, _ := TestStore(ctx, t)
_, store, _ := TestStore(ctx, t)

noteID := uuid.New()
updateID := uuid.New()
Expand Down
8 changes: 4 additions & 4 deletions notifier/postgres/teststore.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ import (
"github.com/jackc/pgx/v4/pgxpool"
_ "github.com/jackc/pgx/v4/stdlib" // Needed for sqlx.Open
"github.com/jmoiron/sqlx"
"github.com/quay/clair/v4/notifier/migrations"
"github.com/quay/claircore/test/integration"
"github.com/remind101/migrate"

"github.com/quay/clair/v4/notifier/migrations"
)

const (
// connection string for our local development. see docker-compose.yaml at root
DefaultDSN = `host=localhost port=5432 user=clair dbname=clair sslmode=disable`
)

func TestStore(ctx context.Context, t testing.TB) (*sqlx.DB, *Store, *KeyStore, func()) {
func TestStore(ctx context.Context, t testing.TB) (*sqlx.DB, *Store, func()) {
if os.Getenv(integration.EnvPGConnString) == "" {
os.Setenv(integration.EnvPGConnString, DefaultDSN)
}
Expand Down Expand Up @@ -57,8 +58,7 @@ func TestStore(ctx context.Context, t testing.TB) (*sqlx.DB, *Store, *KeyStore,
}

s := NewStore(pool)
ks := NewKeyStore(pool)
return sx, s, ks, func() {
return sx, s, func() {
sx.Close()
pool.Close()
db.Close(ctx, t)
Expand Down

0 comments on commit 0ca77ce

Please sign in to comment.