File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,20 @@ import (
12
12
13
13
"github.com/coder/coder/v2/cli/clitest"
14
14
"github.com/coder/coder/v2/cli/config"
15
+ "github.com/coder/coder/v2/coderd/database/dbtestutil"
15
16
"github.com/coder/coder/v2/enterprise/cli"
16
17
"github.com/coder/coder/v2/testutil"
17
18
)
18
19
20
+ func dbArg (t * testing.T ) string {
21
+ if ! dbtestutil .WillUsePostgres () {
22
+ return "--in-memory"
23
+ }
24
+ dbURL , err := dbtestutil .Open (t )
25
+ require .NoError (t , err )
26
+ return "--postgres-url=" + dbURL
27
+ }
28
+
19
29
// TestServer runs the enterprise server command
20
30
// and waits for /healthz to return "OK".
21
31
func TestServer_Single (t * testing.T ) {
@@ -27,9 +37,10 @@ func TestServer_Single(t *testing.T) {
27
37
var root cli.RootCmd
28
38
cmd , err := root .Command (root .EnterpriseSubcommands ())
29
39
require .NoError (t , err )
40
+
30
41
inv , cfg := clitest .NewWithCommand (t , cmd ,
31
42
"server" ,
32
- "--in-memory" ,
43
+ dbArg ( t ) ,
33
44
"--http-address" , ":0" ,
34
45
"--access-url" , "http://example.com" ,
35
46
)
You can’t perform that action at this time.
0 commit comments