chore(coderd/httpmw): remove dbmem usage from tests (#18146)

Related to https://github.com/coder/coder/issues/15109
This commit is contained in:
Hugo Dutka
2025-06-02 13:57:56 +02:00
committed by GitHub
parent f986d13a9c
commit 782d01bae2
14 changed files with 235 additions and 175 deletions

View File

@ -14,7 +14,7 @@ import (
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/dbgen"
"github.com/coder/coder/v2/coderd/database/dbmem"
"github.com/coder/coder/v2/coderd/database/dbtestutil"
"github.com/coder/coder/v2/coderd/httpmw"
"github.com/coder/coder/v2/codersdk"
)
@ -70,7 +70,7 @@ func TestRateLimit(t *testing.T) {
t.Run("RegularUser", func(t *testing.T) {
t.Parallel()
db := dbmem.New()
db, _ := dbtestutil.NewDB(t)
u := dbgen.User(t, db, database.User{})
_, key := dbgen.APIKey(t, db, database.APIKey{UserID: u.ID})
@ -113,7 +113,7 @@ func TestRateLimit(t *testing.T) {
t.Run("OwnerBypass", func(t *testing.T) {
t.Parallel()
db := dbmem.New()
db, _ := dbtestutil.NewDB(t)
u := dbgen.User(t, db, database.User{
RBACRoles: []string{codersdk.RoleOwner},