Skip to content

Commit eb2960f

Browse files
committed
first commit: hugodutka/dbmem-coderd/provisionerdserver
1 parent 7d8b994 commit eb2960f

File tree

3 files changed

+270
-127
lines changed

3 files changed

+270
-127
lines changed

coderd/provisionerdserver/acquirer_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"go.uber.org/goleak"
1919

2020
"github.com/coder/coder/v2/coderd/database"
21-
"github.com/coder/coder/v2/coderd/database/dbmem"
2221
"github.com/coder/coder/v2/coderd/database/dbtestutil"
2322
"github.com/coder/coder/v2/coderd/database/dbtime"
2423
"github.com/coder/coder/v2/coderd/database/provisionerjobs"
@@ -34,7 +33,7 @@ func TestMain(m *testing.M) {
3433
// TestAcquirer_Store tests that a database.Store is accepted as a provisionerdserver.AcquirerStore
3534
func TestAcquirer_Store(t *testing.T) {
3635
t.Parallel()
37-
db := dbmem.New()
36+
db, _ := dbtestutil.NewDB(t)
3837
ps := pubsub.NewInMemory()
3938
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
4039
defer cancel()

coderd/provisionerdserver/provisionerdserver_internal_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
"github.com/coder/coder/v2/coderd/database"
1313
"github.com/coder/coder/v2/coderd/database/dbgen"
14-
"github.com/coder/coder/v2/coderd/database/dbmem"
14+
"github.com/coder/coder/v2/coderd/database/dbtestutil"
1515
"github.com/coder/coder/v2/coderd/database/dbtime"
1616
"github.com/coder/coder/v2/testutil"
1717
)
@@ -21,14 +21,14 @@ func TestObtainOIDCAccessToken(t *testing.T) {
2121
ctx := context.Background()
2222
t.Run("NoToken", func(t *testing.T) {
2323
t.Parallel()
24-
db := dbmem.New()
24+
db, _ := dbtestutil.NewDB(t)
2525
_, err := obtainOIDCAccessToken(ctx, db, nil, uuid.Nil)
2626
require.NoError(t, err)
2727
})
2828
t.Run("InvalidConfig", func(t *testing.T) {
2929
// We still want OIDC to succeed even if exchanging the token fails.
3030
t.Parallel()
31-
db := dbmem.New()
31+
db, _ := dbtestutil.NewDB(t)
3232
user := dbgen.User(t, db, database.User{})
3333
dbgen.UserLink(t, db, database.UserLink{
3434
UserID: user.ID,
@@ -40,7 +40,7 @@ func TestObtainOIDCAccessToken(t *testing.T) {
4040
})
4141
t.Run("MissingLink", func(t *testing.T) {
4242
t.Parallel()
43-
db := dbmem.New()
43+
db, _ := dbtestutil.NewDB(t)
4444
user := dbgen.User(t, db, database.User{
4545
LoginType: database.LoginTypeOIDC,
4646
})
@@ -50,7 +50,7 @@ func TestObtainOIDCAccessToken(t *testing.T) {
5050
})
5151
t.Run("Exchange", func(t *testing.T) {
5252
t.Parallel()
53-
db := dbmem.New()
53+
db, _ := dbtestutil.NewDB(t)
5454
user := dbgen.User(t, db, database.User{})
5555
dbgen.UserLink(t, db, database.UserLink{
5656
UserID: user.ID,

0 commit comments

Comments
 (0)