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

Make cmd/e2e -t work again #3925

Merged
merged 2 commits into from
Jan 29, 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
22 changes: 19 additions & 3 deletions test/e2e/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package e2e

import (
"path"
"regexp"
"strings"
"time"

"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
Expand All @@ -30,6 +32,12 @@ import (

type testResult bool

func init() {
// Turn off colors by default to make it easier to collect console output in Jenkins
// Override colors off with --ginkgo.noColor=false in the command-line
config.DefaultReporterConfig.NoColor = true
}

func (t *testResult) Fail() { *t = false }

// Run each Go end-to-end-test. This function assumes the
Expand All @@ -51,14 +59,22 @@ func RunE2ETests(authConfig, certDir, host, repoRoot, provider string, orderseed
glog.Fatalf("This test has timed out. Cleanup not guaranteed.")
}()

// TODO: Make -t TestName work again.
if len(testList) != 0 {
if config.GinkgoConfig.FocusString != "" || config.GinkgoConfig.SkipString != "" {
glog.Fatal("Either specify --test/-t or --ginkgo.focus/--ginkgo.skip but not both.")
}
var testRegexps []string
for _, t := range testList {
testRegexps = append(testRegexps, regexp.QuoteMeta(t))
}
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)
// Turn of colors for now to make it easier to collect console output in Jenkins
config.DefaultReporterConfig.NoColor = true
var r []ginkgo.Reporter
if reportDir != "" {
// TODO: When we start using parallel tests we need to change this to "junit_%d.xml",
Expand Down