chore(enterprise/audit): remove dbmem from tests (#18794)

Related to https://github.com/coder/coder/issues/15109.
This commit is contained in:
Hugo Dutka
2025-07-08 16:39:02 +02:00
committed by GitHub
parent 7f681910e9
commit f147ebf37d
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -8,7 +8,7 @@ import (
"golang.org/x/xerrors"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/dbmem"
"github.com/coder/coder/v2/coderd/database/dbtestutil"
"github.com/coder/coder/v2/enterprise/audit"
"github.com/coder/coder/v2/enterprise/audit/audittest"
)
@@ -86,11 +86,12 @@ func TestAuditor(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
db, _ := dbtestutil.NewDB(t)
var (
backend = &testBackend{decision: test.backendDecision, err: test.backendError}
exporter = audit.NewAuditor(
dbmem.New(),
db,
audit.FilterFunc(func(_ context.Context, _ database.AuditLog) (audit.FilterDecision, error) {
return test.filterDecision, test.filterError
}),
+2 -2
View File
@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/dbmem"
"github.com/coder/coder/v2/coderd/database/dbtestutil"
"github.com/coder/coder/v2/enterprise/audit"
"github.com/coder/coder/v2/enterprise/audit/audittest"
"github.com/coder/coder/v2/enterprise/audit/backends"
@@ -20,7 +20,7 @@ func TestPostgresBackend(t *testing.T) {
var (
ctx, cancel = context.WithCancel(context.Background())
db = dbmem.New()
db, _ = dbtestutil.NewDB(t)
pgb = backends.NewPostgres(db, true)
alog = audittest.RandomLog()
)