From fa3d6d44f8d3ec9f4cf98551a8ae55e876b697fd Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Fri, 21 Sep 2018 13:14:11 -0700 Subject: [PATCH] E2E - enable focused tests (#3885) --- test/e2e/config/config.go | 1 + test/e2e/runner.go | 6 ++++-- test/e2e/runner/ginkgo.go | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/e2e/config/config.go b/test/e2e/config/config.go index cae7272548..210e55651b 100644 --- a/test/e2e/config/config.go +++ b/test/e2e/config/config.go @@ -34,6 +34,7 @@ type Config struct { SoakClusterName string `envconfig:"SOAK_CLUSTER_NAME"` ForceDeploy bool `envconfig:"FORCE_DEPLOY"` UseDeployCommand bool `envconfig:"USE_DEPLOY_COMMAND"` + GinkgoFocus string `envconfig:"GINKGO_FOCUS"` } const ( diff --git a/test/e2e/runner.go b/test/e2e/runner.go index 205aade0d7..2915c50bd1 100644 --- a/test/e2e/runner.go +++ b/test/e2e/runner.go @@ -215,8 +215,10 @@ func teardown() { log.Printf("cannot fetch openshift metrics: %v", err) } } - if err := cliProvisioner.FetchActivityLog(acct, logsPath); err != nil { - log.Printf("cannot fetch the activity log: %v", err) + if !cfg.SkipLogsCollection { + if err := cliProvisioner.FetchActivityLog(acct, logsPath); err != nil { + log.Printf("cannot fetch the activity log: %v", err) + } } if !cfg.RetainSSH { creds := filepath.Join(cfg.CurrentWorkingDir, "_output/", "*ssh*") diff --git a/test/e2e/runner/ginkgo.go b/test/e2e/runner/ginkgo.go index 25b22b3553..22cb51c17e 100644 --- a/test/e2e/runner/ginkgo.go +++ b/test/e2e/runner/ginkgo.go @@ -34,7 +34,12 @@ func BuildGinkgoRunner(cfg *config.Config, pt *metrics.Point) (*Ginkgo, error) { func (g *Ginkgo) Run() error { g.Point.SetTestStart() testDir := fmt.Sprintf("test/e2e/%s", g.Config.Orchestrator) - cmd := exec.Command("ginkgo", "-slowSpecThreshold", "180", "-r", "-v", testDir) + var cmd *exec.Cmd + if g.Config.GinkgoFocus != "" { + cmd = exec.Command("ginkgo", "-slowSpecThreshold", "180", "-r", "-v", "--focus", g.Config.GinkgoFocus, testDir) + } else { + cmd = exec.Command("ginkgo", "-slowSpecThreshold", "180", "-r", "-v", testDir) + } util.PrintCommand(cmd) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr