From 175ca8bd7a9d8d7dc89115f658da27674153e7ca Mon Sep 17 00:00:00 2001 From: Jarek Kowalski Date: Fri, 19 Mar 2021 21:57:15 -0700 Subject: [PATCH] Misc cleanups (#899) * apiclient: stop logging short-term cookies * testing: unset KOPIA_PASSWORD in tests, which disrupts subprocesses --- internal/apiclient/apiclient.go | 2 +- tests/testenv/cli_test_env.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/apiclient/apiclient.go b/internal/apiclient/apiclient.go index 18f9cb5b4..614e52453 100644 --- a/internal/apiclient/apiclient.go +++ b/internal/apiclient/apiclient.go @@ -199,7 +199,7 @@ func (t loggingTransport) RoundTrip(req *http.Request) (*http.Response, error) { return nil, errors.Wrap(err, "round-trip error") } - log(req.Context()).Debugf("%v %v took %v and returned %v with cookies %v", req.Method, req.URL, clock.Since(t0), resp.Status, resp.Cookies()) + log(req.Context()).Debugf("%v %v took %v and returned %v", req.Method, req.URL, clock.Since(t0), resp.Status) return resp, nil } diff --git a/tests/testenv/cli_test_env.go b/tests/testenv/cli_test_env.go index 5b5c182ba..f78f8e11c 100644 --- a/tests/testenv/cli_test_env.go +++ b/tests/testenv/cli_test_env.go @@ -78,6 +78,9 @@ func NewCLITest(t *testing.T) *CLITest { t.Skip() } + // unset environment variables that disrupt tests when passed to subprocesses. + os.Unsetenv("KOPIA_PASSWORD") + configDir := testutil.TempDirectory(t) cleanName := strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(