Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug of E2E test case #3899

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 15 additions & 12 deletions test/e2e/kibishii_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package e2e

import (
"fmt"
"os"
"os/exec"
"strconv"
"time"
Expand All @@ -40,28 +39,28 @@ func installKibishii(ctx context.Context, namespace string, cloudPlatform string
// We use kustomize to generate YAML for Kibishii from the checked-in yaml directories
kibishiiInstallCmd := exec.CommandContext(ctx, "kubectl", "apply", "-n", namespace, "-k",
"github.com/vmware-tanzu-experiments/distributed-data-generator/kubernetes/yaml/"+cloudPlatform)

_, _, err := veleroexec.RunCommand(kibishiiInstallCmd)
stdout, stderr, err := veleroexec.RunCommand(kibishiiInstallCmd)
if err != nil {
fmt.Println(stdout)
fmt.Println(stderr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is trivial but for consistency, how about handle the stdout/stderr following this convention?

https://github.com/reasonerjt/velero/blob/9ffffda11e90241b6b74e9d81b578e631b435a99/pkg/controller/pod_volume_restore_controller.go#L378

return errors.Wrap(err, "failed to install kibishii")
}

kibishiiSetWaitCmd := exec.CommandContext(ctx, "kubectl", "rollout", "status", "statefulset.apps/kibishii-deployment",
"-n", namespace, "-w", "--timeout=30m")
kibishiiSetWaitCmd.Stdout = os.Stdout
kibishiiSetWaitCmd.Stderr = os.Stderr
_, _, err = veleroexec.RunCommand(kibishiiSetWaitCmd)

stdout, stderr, err = veleroexec.RunCommand(kibishiiSetWaitCmd)
if err != nil {
fmt.Println(stdout)
fmt.Println(stderr)
return err
}

fmt.Printf("Waiting for kibishii jump-pad pod to be ready\n")
jumpPadWaitCmd := exec.CommandContext(ctx, "kubectl", "wait", "--for=condition=ready", "-n", namespace, "pod/jump-pad")
jumpPadWaitCmd.Stdout = os.Stdout
jumpPadWaitCmd.Stderr = os.Stderr
_, _, err = veleroexec.RunCommand(jumpPadWaitCmd)
stdout, stderr, err = veleroexec.RunCommand(jumpPadWaitCmd)
if err != nil {
fmt.Println(stdout)
fmt.Println(stderr)
return errors.Wrapf(err, "Failed to wait for ready status of pod %s/%s", namespace, jumpPadPod)
}

Expand All @@ -75,8 +74,10 @@ func generateData(ctx context.Context, namespace string, levels int, filesPerLev
strconv.Itoa(blockSize), strconv.Itoa(passNum), strconv.Itoa(expectedNodes))
fmt.Printf("kibishiiGenerateCmd cmd =%v\n", kibishiiGenerateCmd)

_, _, err := veleroexec.RunCommand(kibishiiGenerateCmd)
stdout, stderr, err := veleroexec.RunCommand(kibishiiGenerateCmd)
if err != nil {
fmt.Println(stdout)
fmt.Println(stderr)
return errors.Wrap(err, "failed to generate")
}

Expand All @@ -90,8 +91,10 @@ func verifyData(ctx context.Context, namespace string, levels int, filesPerLevel
strconv.Itoa(blockSize), strconv.Itoa(passNum), strconv.Itoa(expectedNodes))
fmt.Printf("kibishiiVerifyCmd cmd =%v\n", kibishiiVerifyCmd)

_, _, err := veleroexec.RunCommand(kibishiiVerifyCmd)
stdout, stderr, err := veleroexec.RunCommand(kibishiiVerifyCmd)
if err != nil {
fmt.Println(stdout)
fmt.Println(stderr)
return errors.Wrap(err, "failed to verify")
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/velero_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ func veleroAddPluginsForProvider(ctx context.Context, veleroCLI string, veleroNa

installPluginCmd := exec.CommandContext(ctx, veleroCLI, "--namespace", veleroNamespace, "plugin", "add", plugin)
installPluginCmd.Stdout = stdoutBuf
installPluginCmd.Stderr = stdoutBuf
installPluginCmd.Stderr = stderrBuf

err := installPluginCmd.Run()

Expand Down