Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the e2e --times flag for running tests more than once #4569

Merged
merged 1 commit into from
Feb 19, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions test/e2e/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package e2e

import (
"fmt"
"path"
"regexp"
"strings"
Expand Down Expand Up @@ -63,19 +64,18 @@ func RunE2ETests(authConfig, certDir, host, repoRoot, provider string, orderseed
config.GinkgoConfig.FocusString = `\b(` + strings.Join(testRegexps, "|") + `)\b`
}

// TODO: Make "times" work again.
// TODO: Make orderseed work again.

var passed testResult = true
gomega.RegisterFailHandler(ginkgo.Fail)
var r []ginkgo.Reporter
if reportDir != "" {
// TODO: When we start using parallel tests we need to change this to "junit_%d.xml",
// see ginkgo docs for more details.
r = append(r, reporters.NewJUnitReporter(path.Join(reportDir, "junit.xml")))
}
// Run the existing tests with output to console + JUnit for Jenkins
ginkgo.RunSpecsWithDefaultAndCustomReporters(&passed, "Kubernetes e2e Suite", r)
for i := 0; i < times && passed; i++ {
var r []ginkgo.Reporter
if reportDir != "" {
r = append(r, reporters.NewJUnitReporter(path.Join(reportDir, fmt.Sprintf("junit_%d.xml", i+1))))
}
ginkgo.RunSpecsWithDefaultAndCustomReporters(&passed, fmt.Sprintf("Kubernetes e2e Suite run %d of %d", i+1, times), r)
}

if !passed {
glog.Fatalf("At least one test failed")
Expand Down