Ensure warning is on stderr and not stdout.
This commit is contained in:
parent
acd23c4c37
commit
842ef38868
@ -443,7 +443,8 @@ func TestE2EFullIntegration(t *testing.T) { // nolint:gocyclo
|
|||||||
start := time.Now()
|
start := time.Now()
|
||||||
kubectlCmd := exec.CommandContext(ctx, "kubectl", "get", "namespace", "--kubeconfig", kubeconfigPath)
|
kubectlCmd := exec.CommandContext(ctx, "kubectl", "get", "namespace", "--kubeconfig", kubeconfigPath)
|
||||||
kubectlCmd.Env = append(os.Environ(), env.ProxyEnv()...)
|
kubectlCmd.Env = append(os.Environ(), env.ProxyEnv()...)
|
||||||
|
stdoutPipe, err := kubectlCmd.StdoutPipe()
|
||||||
|
require.NoError(t, err)
|
||||||
ptyFile, err := pty.Start(kubectlCmd)
|
ptyFile, err := pty.Start(kubectlCmd)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
@ -485,9 +486,10 @@ func TestE2EFullIntegration(t *testing.T) { // nolint:gocyclo
|
|||||||
t.Logf("waiting for kubectl to output namespace list")
|
t.Logf("waiting for kubectl to output namespace list")
|
||||||
// Read all output from the subprocess until EOF.
|
// Read all output from the subprocess until EOF.
|
||||||
// Ignore any errors returned because there is always an error on linux.
|
// Ignore any errors returned because there is always an error on linux.
|
||||||
kubectlOutputBytes, _ := ioutil.ReadAll(ptyFile)
|
kubectlStdOutOutputBytes, _ := ioutil.ReadAll(stdoutPipe)
|
||||||
requireKubectlGetNamespaceOutput(t, env, string(kubectlOutputBytes))
|
kubectlStdErrOutputBytes, _ := ioutil.ReadAll(ptyFile)
|
||||||
require.Contains(t, string(kubectlOutputBytes), "Access token from identity provider has lifetime of less than 3 hours. Expect frequent prompts to log in.")
|
requireKubectlGetNamespaceOutput(t, env, string(kubectlStdOutOutputBytes))
|
||||||
|
require.Contains(t, string(kubectlStdErrOutputBytes), "Access token from identity provider has lifetime of less than 3 hours. Expect frequent prompts to log in.")
|
||||||
|
|
||||||
t.Logf("first kubectl command took %s", time.Since(start).String())
|
t.Logf("first kubectl command took %s", time.Since(start).String())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user