mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore(enterprise/audit): remove dbmem from tests (#18794)
Related to https://github.com/coder/coder/issues/15109.
This commit is contained in:
@@ -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
|
||||
}),
|
||||
|
||||
@@ -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()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user