Expose ginkgo.focus and skip-globals flags in e2e_test

Signed-off-by: James Munnelly <james@munnelly.eu>
This commit is contained in:
James Munnelly
2019-04-30 12:36:18 +01:00
parent 546d3f1d76
commit 41970407c6
3 changed files with 20 additions and 5 deletions
+4
View File
@@ -17,7 +17,9 @@ DOCKER_REPO :=
APP_VERSION := canary
HACK_DIR ?= hack
SKIP_GLOBALS := false
GINKGO_SKIP :=
GINKGO_FOCUS :=
## e2e test vars
KUBECTL ?= kubectl
@@ -118,6 +120,8 @@ e2e_test:
--repo-root="$$(pwd)" \
--report-dir="$${ARTIFACTS:-./_artifacts}" \
--ginkgo.skip="$(GINKGO_SKIP)" \
--ginkgo.focus="$(GINKGO_FOCUS)" \
--skip-globals=$(SKIP_GLOBALS) \
--kubectl-path="$(KUBECTL)"
# Generate targets
+9 -5
View File
@@ -33,7 +33,9 @@ var (
)
var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
addon.InitGlobals(cfg)
if !cfg.Addons.SkipGlobals {
addon.InitGlobals(cfg)
}
ginkgo.By("Provisioning shared cluster addons")
@@ -81,9 +83,11 @@ var _ = ginkgo.SynchronizedAfterSuite(func() {},
}
}
ginkgo.By("Cleaning up the provisioned globals")
err = addon.DeprovisionGlobals(cfg)
if err != nil {
framework.Failf("Error deprovisioning global addons: %v", err)
if !cfg.Addons.SkipGlobals {
ginkgo.By("Cleaning up the provisioned globals")
err = addon.DeprovisionGlobals(cfg)
if err != nil {
framework.Failf("Error deprovisioning global addons: %v", err)
}
}
})
+7
View File
@@ -40,6 +40,10 @@ type Addons struct {
// Venafi describes global configuration variables for the Venafi tests.
// This includes credentials for the Venafi TPP server to use during runs.
Venafi Venafi
// If true, global addons will not be provisioned before running tests.
// This is useful when developing locally.
SkipGlobals bool
}
func (a *Addons) AddFlags(fs *flag.FlagSet) {
@@ -48,6 +52,9 @@ func (a *Addons) AddFlags(fs *flag.FlagSet) {
a.Pebble.AddFlags(fs)
a.Nginx.AddFlags(fs)
a.Venafi.AddFlags(fs)
fs.BoolVar(&a.SkipGlobals, "skip-globals", false, "If true, global addons will not be "+
"provisioned before running tests")
}
func (c *Addons) Validate() []error {