fix: Set cache dir for coderd tests (#3160)

* fix: Set cache dir for coderd in codedtest

* fix: Ensure server cli tests have a cache path

To avoid sharing default path.
This commit is contained in:
Mathias Fredriksson
2022-07-25 19:24:32 +03:00
committed by GitHub
parent 6916d34458
commit 1c04b20fde
3 changed files with 79 additions and 15 deletions
+6 -1
View File
@@ -38,7 +38,12 @@ func TestResetPassword(t *testing.T) {
defer closeFunc()
ctx, cancelFunc := context.WithCancel(context.Background())
serverDone := make(chan struct{})
serverCmd, cfg := clitest.New(t, "server", "--address", ":0", "--postgres-url", connectionURL)
serverCmd, cfg := clitest.New(t,
"server",
"--address", ":0",
"--postgres-url", connectionURL,
"--cache-dir", t.TempDir(),
)
go func() {
defer close(serverDone)
err = serverCmd.ExecuteContext(ctx)