Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitea145b8

Browse files
committed
first commit: hugodutka/dbmem-enterprise-cli
1 parente0fb15e commitea145b8

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

‎enterprise/cli/server_dbcrypt_test.go‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ import (
2424
//
2525
// nolint: paralleltest // use of t.Setenv
2626
funcTestServerDBCrypt(t*testing.T) {
27-
if!dbtestutil.WillUsePostgres() {
28-
t.Skip("this test requires a postgres instance")
29-
}
30-
3127
ctx,cancel:=context.WithCancel(context.Background())
3228
t.Cleanup(cancel)
3329

‎enterprise/cli/server_test.go‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,20 @@ import (
1212

1313
"github.com/coder/coder/v2/cli/clitest"
1414
"github.com/coder/coder/v2/cli/config"
15+
"github.com/coder/coder/v2/coderd/database/dbtestutil"
1516
"github.com/coder/coder/v2/enterprise/cli"
1617
"github.com/coder/coder/v2/testutil"
1718
)
1819

20+
funcdbArg(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+
1929
// TestServer runs the enterprise server command
2030
// and waits for /healthz to return "OK".
2131
funcTestServer_Single(t*testing.T) {
@@ -27,9 +37,10 @@ func TestServer_Single(t *testing.T) {
2737
varroot cli.RootCmd
2838
cmd,err:=root.Command(root.EnterpriseSubcommands())
2939
require.NoError(t,err)
40+
3041
inv,cfg:=clitest.NewWithCommand(t,cmd,
3142
"server",
32-
"--in-memory",
43+
dbArg(t),
3344
"--http-address",":0",
3445
"--access-url","http://example.com",
3546
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp