From 8ca5519f57531ac8123c36e90ac1aaecda5ea314 Mon Sep 17 00:00:00 2001 From: Hugo Dutka Date: Mon, 2 Jun 2025 14:07:31 +0200 Subject: [PATCH] chore(coderd/idpsync): run all tests with postgres (#18149) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Related to https://github.com/coder/coder/issues/15109. Running postgres tests used to create a new postgres docker container every time. I believe the slow down might've been caused by that and was misattributed to postgres performance. ``` coder@main ~/coder ((0e90ac29))> DB=ci gotestsum --packages="./coderd/idpsync" -- -count=1 ✓ coderd/idpsync (1.471s) DONE 91 tests in 4.766s ``` --- coderd/idpsync/group_test.go | 9 --------- coderd/idpsync/role_test.go | 4 ---- 2 files changed, 13 deletions(-) diff --git a/coderd/idpsync/group_test.go b/coderd/idpsync/group_test.go index 58024ed2f6..7b0fb70ae8 100644 --- a/coderd/idpsync/group_test.go +++ b/coderd/idpsync/group_test.go @@ -69,11 +69,6 @@ func TestParseGroupClaims(t *testing.T) { func TestGroupSyncTable(t *testing.T) { t.Parallel() - // Last checked, takes 30s with postgres on a fast machine. - if dbtestutil.WillUsePostgres() { - t.Skip("Skipping test because it populates a lot of db entries, which is slow on postgres.") - } - userClaims := jwt.MapClaims{ "groups": []string{ "foo", "bar", "baz", @@ -379,10 +374,6 @@ func TestGroupSyncTable(t *testing.T) { func TestSyncDisabled(t *testing.T) { t.Parallel() - if dbtestutil.WillUsePostgres() { - t.Skip("Skipping test because it populates a lot of db entries, which is slow on postgres.") - } - db, _ := dbtestutil.NewDB(t) manager := runtimeconfig.NewManager() s := idpsync.NewAGPLSync(slogtest.Make(t, &slogtest.Options{}), diff --git a/coderd/idpsync/role_test.go b/coderd/idpsync/role_test.go index f1cebc1884..f07d97a2b0 100644 --- a/coderd/idpsync/role_test.go +++ b/coderd/idpsync/role_test.go @@ -27,10 +27,6 @@ import ( func TestRoleSyncTable(t *testing.T) { t.Parallel() - if dbtestutil.WillUsePostgres() { - t.Skip("Skipping test because it populates a lot of db entries, which is slow on postgres.") - } - userClaims := jwt.MapClaims{ "roles": []string{ "foo", "bar", "baz",