From d3ed6fe6521aef7df944eb15d1b5bccccc7b9554 Mon Sep 17 00:00:00 2001 From: Hugo Dutka Date: Mon, 2 Jun 2025 13:58:07 +0200 Subject: [PATCH] chore(coderd/autobuild): use dbtestutil.WillUsePostgres instead of os.Getenv in test (#18145) Standardizing on `WillUsePostgres` will make it easier to remove the check entirely once dbmem is removed. Related to https://github.com/coder/coder/issues/15109. --- coderd/autobuild/lifecycle_executor_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/coderd/autobuild/lifecycle_executor_test.go b/coderd/autobuild/lifecycle_executor_test.go index 7a0b2af441..453de63031 100644 --- a/coderd/autobuild/lifecycle_executor_test.go +++ b/coderd/autobuild/lifecycle_executor_test.go @@ -2,7 +2,6 @@ package autobuild_test import ( "context" - "os" "testing" "time" @@ -741,7 +740,7 @@ func TestExecutorWorkspaceAutostopNoWaitChangedMyMind(t *testing.T) { } func TestExecutorAutostartMultipleOK(t *testing.T) { - if os.Getenv("DB") == "" { + if !dbtestutil.WillUsePostgres() { t.Skip(`This test only really works when using a "real" database, similar to a HA setup`) }