From fe4e2d620d1ab5f6d8a7e0f52a9a92acb3c7ef41 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Mon, 14 Dec 2020 13:25:03 -0600 Subject: [PATCH] Update TestCLIGetKubeconfig to ignore stderr output from `get-kubeconfig`. This will now have a deprecation warning, so we can't treat is as part of the YAML output. Signed-off-by: Matt Moyer --- test/integration/cli_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/integration/cli_test.go b/test/integration/cli_test.go index 707fe0e7..c0858a38 100644 --- a/test/integration/cli_test.go +++ b/test/integration/cli_test.go @@ -102,9 +102,14 @@ func runPinnipedCLIGetKubeconfig(t *testing.T, pinnipedExe, token, namespaceName "--pinniped-namespace", namespaceName, "--authenticator-type", authenticatorType, "--authenticator-name", authenticatorName, - ).CombinedOutput() - require.NoError(t, err, string(output)) + ).Output() + // Log stderr if there is a problem. + var exitErr *exec.ExitError + if errors.As(err, &exitErr) { + t.Logf("stderr:\n%s\n", string(exitErr.Stderr)) + } + require.NoError(t, err, string(output)) return string(output) }