mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(enterprise/coderd): remove dbmem from tests (#18797)
Related to https://github.com/coder/coder/issues/15109.
This commit is contained in:
@@ -42,7 +42,6 @@ import (
|
||||
"github.com/coder/coder/v2/coderd/database"
|
||||
"github.com/coder/coder/v2/coderd/database/dbauthz"
|
||||
"github.com/coder/coder/v2/coderd/database/dbfake"
|
||||
"github.com/coder/coder/v2/coderd/database/dbmem"
|
||||
"github.com/coder/coder/v2/coderd/database/dbtestutil"
|
||||
"github.com/coder/coder/v2/coderd/database/dbtime"
|
||||
"github.com/coder/coder/v2/coderd/rbac"
|
||||
@@ -323,10 +322,11 @@ func TestAuditLogging(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Run("Enabled", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
db, _ := dbtestutil.NewDB(t)
|
||||
_, _, api, _ := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
|
||||
AuditLogging: true,
|
||||
Options: &coderdtest.Options{
|
||||
Auditor: audit.NewAuditor(dbmem.New(), audit.DefaultFilter),
|
||||
Auditor: audit.NewAuditor(db, audit.DefaultFilter),
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
@@ -334,8 +334,9 @@ func TestAuditLogging(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
db, _ = dbtestutil.NewDB(t)
|
||||
auditor := *api.AGPL.Auditor.Load()
|
||||
ea := audit.NewAuditor(dbmem.New(), audit.DefaultFilter)
|
||||
ea := audit.NewAuditor(db, audit.DefaultFilter)
|
||||
t.Logf("%T = %T", auditor, ea)
|
||||
assert.EqualValues(t, reflect.ValueOf(ea).Type(), reflect.ValueOf(auditor).Type())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user