Merge pull request #52606 from Random-Liu/local-node-e2e-return-error

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Let local node e2e return error.

Fixes #52665

Let `make test-e2e-node` return error when it fails. Now it always returns exit code 0, whenever it fails or not.

@yguo0905 Could you help me review this?

Signed-off-by: Lantao Liu <lantaol@google.com>
pull/6/head
Kubernetes Submit Queue 2017-10-06 21:53:03 -07:00 committed by GitHub
commit d9bc7f0896
1 changed files with 10 additions and 8 deletions

View File

@ -57,16 +57,18 @@ func main() {
ginkgo := filepath.Join(outputDir, "ginkgo")
test := filepath.Join(outputDir, "e2e_node.test")
if *systemSpecName == "" {
runCommand(ginkgo, *ginkgoFlags, test, "--", *testFlags)
return
args := []string{*ginkgoFlags, test, "--", *testFlags}
if *systemSpecName != "" {
rootDir, err := builder.GetK8sRootDir()
if err != nil {
glog.Fatalf("Failed to get k8s root directory: %v", err)
}
systemSpecFile := filepath.Join(rootDir, systemSpecPath, *systemSpecName+".yaml")
args = append(args, fmt.Sprintf("--system-spec-name=%s --system-spec-file=%s", *systemSpecName, systemSpecFile))
}
rootDir, err := builder.GetK8sRootDir()
if err != nil {
glog.Fatalf("Failed to get k8s root directory: %v", err)
if err := runCommand(ginkgo, args...); err != nil {
glog.Exitf("Test failed: %v", err)
}
systemSpecFile := filepath.Join(rootDir, systemSpecPath, *systemSpecName+".yaml")
runCommand(ginkgo, *ginkgoFlags, test, "--", fmt.Sprintf("--system-spec-name=%s --system-spec-file=%s", *systemSpecName, systemSpecFile), *testFlags)
return
}