mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(enterprise/cli): remove dbmem from tests (#18795)
Related to https://github.com/coder/coder/issues/15109.
This commit is contained in:
@@ -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",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user