Skip to content

Commit

Permalink
Merge pull request kubernetes#1107 from pwittrock/fix-integration-test
Browse files Browse the repository at this point in the history
fix integration tests always passing because of obscure golang variab…
  • Loading branch information
Phillip Wittrock committed Feb 11, 2016
2 parents 8fbb008 + cf8f46f commit 967e6bb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions integration/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,15 @@ func PushAndRunTests(host, testDir string) error {
if err != nil {
// Copy logs from the host
args = common.GetGCComputeArgs("copy-files", fmt.Sprintf("%s:%s/log.txt", host, testDir), "./")
err = RunCommand("gcloud", args...)
if err != nil {
return fmt.Errorf("error fetching logs: %v", err)
// Declare new error or it will get shadowed by logs, err := <> and we won't be able to unset it from nil
err2 := RunCommand("gcloud", args...)
if err2 != nil {
return fmt.Errorf("error fetching logs: %v for %v", err2, err)
}
defer os.Remove("./log.txt")
logs, err := ioutil.ReadFile("./log.txt")
if err != nil {
return fmt.Errorf("error reading local log file: %v", err)
logs, err2 := ioutil.ReadFile("./log.txt")
if err2 != nil {
return fmt.Errorf("error reading local log file: %v for %v", err2, err)
}
glog.Errorf("----------------------\nLogs from Host: %q\n%v\n", host, string(logs))
err = fmt.Errorf("error on host %s: %v\n%+v", host, err, attributes)
Expand Down

0 comments on commit 967e6bb

Please sign in to comment.