From a64786a7289305bff62c41514c42eb120d07ae94 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Thu, 11 Mar 2021 15:47:39 -0600 Subject: [PATCH] Fix TestCLIGetKubeconfigStaticToken for new CLI log output. Signed-off-by: Matt Moyer --- test/integration/cli_test.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/integration/cli_test.go b/test/integration/cli_test.go index f2479d0c..c5e18907 100644 --- a/test/integration/cli_test.go +++ b/test/integration/cli_test.go @@ -20,6 +20,7 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/sync/errgroup" "gopkg.in/square/go-jose.v2" @@ -47,9 +48,9 @@ func TestCLIGetKubeconfigStaticToken(t *testing.T) { pinnipedExe := library.PinnipedCLIPath(t) for _, tt := range []struct { - name string - args []string - expectStderr string + name string + args []string + expectStderrContains []string }{ { name: "newer command, but still using static parameters", @@ -60,12 +61,20 @@ func TestCLIGetKubeconfigStaticToken(t *testing.T) { "--concierge-authenticator-type", "webhook", "--concierge-authenticator-name", authenticator.Name, }, + expectStderrContains: []string{ + "discovered CredentialIssuer", + "discovered Concierge endpoint", + "discovered Concierge certificate authority bundle", + "validated connection to the cluster", + }, }, } { tt := tt t.Run(tt.name, func(t *testing.T) { stdout, stderr := runPinnipedCLI(t, nil, pinnipedExe, tt.args...) - require.Equal(t, tt.expectStderr, stderr) + for _, s := range tt.expectStderrContains { + assert.Contains(t, stderr, s) + } // Even the deprecated command should now generate a kubeconfig with the new "pinniped login static" command. restConfig := library.NewRestConfigFromKubeconfig(t, stdout)