mirror of
https://github.com/wahyd4/cert-manager.git
synced 2026-08-09 05:06:38 +10:00
Expose ginkgo.focus and skip-globals flags in e2e_test
Signed-off-by: James Munnelly <james@munnelly.eu>
This commit is contained in:
@@ -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
@@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user