Skip to content

Commit

Permalink
log statements to debug e2e test failure
Browse files Browse the repository at this point in the history
Signed-off-by: Dhruv-J <[email protected]>
  • Loading branch information
Dhruv-J committed Jul 17, 2023
1 parent 8f85211 commit 56ff2a3
Showing 1 changed file with 6 additions and 27 deletions.
33 changes: 6 additions & 27 deletions test/e2e/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,7 @@ func (data *TestData) killProcessesAndCollectCovFiles(namespace, podName, contai
log.Infof("Copying coverage files from worker nodes kind-worker and kind-worker2")
cmd := "/bin/sh -c find / -name 'covmeta.*' -exec basename {} ';'"
rc, stdout, stderr, err := data.RunCommandOnNode("kind-worker", cmd)
log.Infof("first find command run")
var files []string
if err != nil || rc != 0 {
if !strings.Contains(err.Error(), "No such file or directory") {
Expand All @@ -1655,6 +1656,7 @@ func (data *TestData) killProcessesAndCollectCovFiles(namespace, podName, contai
}
cmd = "/bin/sh -c find / -name 'covcounters.*' -exec basename {} ';'"
rc, stdout, stderr, err = data.RunCommandOnNode("kind-worker", cmd)
log.Infof("second find command run")
if err != nil || rc != 0 {
if !strings.Contains(err.Error(), "No such file or directory") {
return fmt.Errorf("error when running this find command (for coverage file) '%s' on Node kind-worker, stderr: <%v>, err: <%v>", cmd, stderr, err)
Expand All @@ -1673,8 +1675,10 @@ func (data *TestData) killProcessesAndCollectCovFiles(namespace, podName, contai
return fmt.Errorf("error when copying coverage files from Pod '%s' to coverage directory '%s': %v", podName, covDir, err)
}
}
log.Infof("first node copy run")
cmd = "/bin/sh -c find / -name 'covmeta.*' -exec basename {} ';'"
rc, stdout, stderr, err = data.RunCommandOnNode("kind-worker2", cmd)
log.Infof("third find command run")
if err != nil || rc != 0 {
if !strings.Contains(err.Error(), "No such file or directory") {
return fmt.Errorf("error when running this find command (for coverage file) '%s' on Node kind-worker2, stderr: <%v>, err: <%v>", cmd, stderr, err)
Expand All @@ -1684,6 +1688,7 @@ func (data *TestData) killProcessesAndCollectCovFiles(namespace, podName, contai
}
cmd = "/bin/sh -c find / -name 'covcounters.*' -exec basename {} ';'"
rc, stdout, stderr, err = data.RunCommandOnNode("kind-worker2", cmd)
log.Infof("fourth find command run")
if err != nil || rc != 0 {
if !strings.Contains(err.Error(), "No such file or directory") {
return fmt.Errorf("error when running this find command (for coverage file) '%s' on Node kind-worker2, stderr: <%v>, err: <%v>", cmd, stderr, err)
Expand All @@ -1703,33 +1708,7 @@ func (data *TestData) killProcessesAndCollectCovFiles(namespace, podName, contai
return fmt.Errorf("error when copying coverage files from Pod '%s' to coverage directory '%s': %v", podName, covDir, err)
}
}
// cmd = "/bin/sh -c find / -name 'covmeta.*' -exec basename {} ';'"
// rc, stdout, stderr, err = data.RunCommandOnNode("kind-worker2", cmd)
// if err != nil || rc != 0 {
// return fmt.Errorf("error when running this find command (for coverage file) '%s' on Node kind-worker2, stderr: <%v>, err: <%v>", cmd, stderr, err)
// }
// stdout = strings.TrimSpace(stdout)
// files = strings.Split(stdout, "\n")
// cmd = "/bin/sh -c find / -name 'covcounters.*' -exec basename {} ';'"
// rc, stdout, stderr, err = data.RunCommandOnNode("kind-worker", cmd)
// if err != nil || rc != 0 {
// return fmt.Errorf("error when running this find command (for coverage file) '%s' on Node kind-worker, stderr: <%v>, err: <%v>", cmd, stderr, err)
// }
// stdout = strings.TrimSpace(stdout)
// files = append(files, strings.Split(stdout, "\n")...)
// fmt.Println("-------- length of kind-worker2 files: "+fmt.Sprint(len(files)))
// for _, file := range files {
// fmt.Println("copyNodeFiles iteration ")
// if len(file) == 0 {
// fmt.Println("file "+file+" was empty");
// continue
// }
// // err := data.copyPodFiles(podName, containerName, namespace, file, covDir)
// err := data.copyNodeFiles("kind-worker2", file, covDir)
// if err != nil {
// return fmt.Errorf("error when copying coverage files from Pod '%s' to coverage directory '%s': %v", podName, covDir, err)
// }
// }
log.Infof("second node copy run")
return nil
}

Expand Down

0 comments on commit 56ff2a3

Please sign in to comment.