chore(enterprise/cli): remove dbmem from tests (#18795)

Related to https://github.com/coder/coder/issues/15109.
This commit is contained in:
Hugo Dutka
2025-07-08 14:59:03 +00:00
committed by GitHub
parent f147ebf37d
commit 733d3f1287
+12 -1
View File
@@ -12,10 +12,20 @@ import (
"github.com/coder/coder/v2/cli/clitest"
"github.com/coder/coder/v2/cli/config"
"github.com/coder/coder/v2/coderd/database/dbtestutil"
"github.com/coder/coder/v2/enterprise/cli"
"github.com/coder/coder/v2/testutil"
)
func dbArg(t *testing.T) string {
if !dbtestutil.WillUsePostgres() {
return "--in-memory"
}
dbURL, err := dbtestutil.Open(t)
require.NoError(t, err)
return "--postgres-url=" + dbURL
}
// TestServer runs the enterprise server command
// and waits for /healthz to return "OK".
func TestServer_Single(t *testing.T) {
@@ -27,9 +37,10 @@ func TestServer_Single(t *testing.T) {
var root cli.RootCmd
cmd, err := root.Command(root.EnterpriseSubcommands())
require.NoError(t, err)
inv, cfg := clitest.NewWithCommand(t, cmd,
"server",
"--in-memory",
dbArg(t),
"--http-address", ":0",
"--access-url", "http://example.com",
)