Skip to content

Commit

Permalink
Merge pull request #3139 from justinsb/hints_on_cf_test
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Add hints to CF integration test
  • Loading branch information
Kubernetes Submit Queue committed Aug 24, 2017
2 parents 5b76cd3 + 434e1d2 commit e668348
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/kops/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ func runTestCloudformation(t *testing.T, clusterName string, srcDir string, vers
t.Fatalf("unexpected files. actual=%q, expected=%q", actualFilenames, expectedFilenames)
}

actualCF, err := ioutil.ReadFile(path.Join(h.TempDir, "out", "kubernetes.json"))
actualPath := path.Join(h.TempDir, "out", "kubernetes.json")
actualCF, err := ioutil.ReadFile(actualPath)
if err != nil {
t.Fatalf("unexpected error reading actual cloudformation output: %v", err)
}
Expand All @@ -340,6 +341,12 @@ func runTestCloudformation(t *testing.T, clusterName string, srcDir string, vers
diffString := diff.FormatDiff(expectedCFTrimmed, actualCFTrimmed)
t.Logf("diff:\n%s\n", diffString)

if os.Getenv("KEEP_TEMP_DIR") == "" {
t.Logf("(hint: setting KEEP_TEMP_DIR will preserve test output")
} else {
t.Logf("actual terraform output in %s", actualPath)
}

t.Fatalf("cloudformation output differed from expected")
}
}
Expand Down

0 comments on commit e668348

Please sign in to comment.