Skip to content

Commit 145023f

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

File tree

3 files changed

+270
-128
lines changed

3 files changed

+270
-128
lines changed

coderd/provisionerdserver/acquirer_test.go

Lines changed: 1 addition & 3 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,8 +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()
38-
ps := pubsub.NewInMemory()
36+
db, ps := dbtestutil.NewDB(t)
3937
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
4038
defer cancel()
4139
logger := testutil.Logger(t)

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy