diff --git a/Makefile b/Makefile index 9b925f86a..e19d28a20 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index b6e03702c..750bd8401 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -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) + } } }) diff --git a/test/e2e/framework/config/addons.go b/test/e2e/framework/config/addons.go index dab0399cc..cba38ee89 100644 --- a/test/e2e/framework/config/addons.go +++ b/test/e2e/framework/config/addons.go @@ -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 {