Merge pull request #1107 from pwittrock/fix-integration-test
fix integration tests always passing because of obscure golang variab…
This commit is contained in:
commit
967e6bb864
@ -172,14 +172,15 @@ func PushAndRunTests(host, testDir string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
// Copy logs from the host
|
// Copy logs from the host
|
||||||
args = common.GetGCComputeArgs("copy-files", fmt.Sprintf("%s:%s/log.txt", host, testDir), "./")
|
args = common.GetGCComputeArgs("copy-files", fmt.Sprintf("%s:%s/log.txt", host, testDir), "./")
|
||||||
err = RunCommand("gcloud", args...)
|
// Declare new error or it will get shadowed by logs, err := <> and we won't be able to unset it from nil
|
||||||
if err != nil {
|
err2 := RunCommand("gcloud", args...)
|
||||||
return fmt.Errorf("error fetching logs: %v", err)
|
if err2 != nil {
|
||||||
|
return fmt.Errorf("error fetching logs: %v for %v", err2, err)
|
||||||
}
|
}
|
||||||
defer os.Remove("./log.txt")
|
defer os.Remove("./log.txt")
|
||||||
logs, err := ioutil.ReadFile("./log.txt")
|
logs, err2 := ioutil.ReadFile("./log.txt")
|
||||||
if err != nil {
|
if err2 != nil {
|
||||||
return fmt.Errorf("error reading local log file: %v", err)
|
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))
|
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)
|
err = fmt.Errorf("error on host %s: %v\n%+v", host, err, attributes)
|
||||||
|
Loading…
Reference in New Issue
Block a user