Rework Ginkgo usage (#9522)
* Rework Ginkgo usage Currently Ginkgo is launched multiple times with different options to accomodate various use-cases. In particular, some specs needs to be run sequentially because non-namespaced objects are created that conflicts with concurent Helm deployments. However Ginkgo is able to handle such cases natively, in particular specs that needs to be run sequentially are supported (Serial spec). This commit marks the specs that needs to be run sequentially as Serial specs and runs the whole test suite from a single Ginkgo invocation. As a result, a single JUnit report is now generated. Signed-off-by: Hervé Werner <dud225@hotmail.com> * Fix controller error in test Error getting ConfigMap "$NAMESPACE/tcp-services": no object matching key "$NAMESPACE/tcp-services" in local store Signed-off-by: Hervé Werner <dud225@hotmail.com> * Replace "go get" invocations by "go install" Executing "go get" changes the go.mod & go.sum files which is not the case of "go install". Signed-off-by: Hervé Werner <dud225@hotmail.com> * Always clean out the Helm deployment Signed-off-by: Hervé Werner <dud225@hotmail.com> * Add E2E test to verify that changes to one or more configmap trigger an update Signed-off-by: Hervé Werner <dud225@hotmail.com> --------- Signed-off-by: Hervé Werner <dud225@hotmail.com>
This commit is contained in:
parent
080c905fab
commit
d6bba85351
20 changed files with 165 additions and 252 deletions
|
|
@ -150,7 +150,11 @@ func (f *Framework) AfterEach() {
|
|||
|
||||
defer func(kubeClient kubernetes.Interface, ingressclass string) {
|
||||
defer ginkgo.GinkgoRecover()
|
||||
err := deleteIngressClass(kubeClient, ingressclass)
|
||||
|
||||
err := f.UninstallChart()
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "uninstalling helm chart")
|
||||
|
||||
err = deleteIngressClass(kubeClient, ingressclass)
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "deleting IngressClass")
|
||||
}(f.KubeClientSet, f.IngressClass)
|
||||
|
||||
|
|
@ -192,6 +196,11 @@ func IngressNginxDescribe(text string, body func()) bool {
|
|||
return ginkgo.Describe(text, body)
|
||||
}
|
||||
|
||||
// IngressNginxDescribeSerial wrapper function for ginkgo describe. Adds namespacing.
|
||||
func IngressNginxDescribeSerial(text string, body func()) bool {
|
||||
return ginkgo.Describe(text, ginkgo.Serial, body)
|
||||
}
|
||||
|
||||
// DescribeAnnotation wrapper function for ginkgo describe. Adds namespacing.
|
||||
func DescribeAnnotation(text string, body func()) bool {
|
||||
return ginkgo.Describe("[Annotations] "+text, body)
|
||||
|
|
@ -202,11 +211,6 @@ func DescribeSetting(text string, body func()) bool {
|
|||
return ginkgo.Describe("[Setting] "+text, body)
|
||||
}
|
||||
|
||||
// MemoryLeakIt is wrapper function for ginkgo It. Adds "[MemoryLeak]" tag and makes static analysis easier.
|
||||
func MemoryLeakIt(text string, body interface{}) bool {
|
||||
return ginkgo.It(text+" [MemoryLeak]", body)
|
||||
}
|
||||
|
||||
// GetNginxIP returns the number of TCP port where NGINX is running
|
||||
func (f *Framework) GetNginxIP() string {
|
||||
s, err := f.KubeClientSet.
|
||||
|
|
@ -387,7 +391,7 @@ func (f *Framework) UpdateNginxConfigMapData(key string, value string) {
|
|||
}
|
||||
|
||||
// WaitForReload calls the passed function and
|
||||
// asser it has caused at least 1 reload.
|
||||
// asserts it has caused at least 1 reload.
|
||||
func (f *Framework) WaitForReload(fn func()) {
|
||||
initialReloadCount := getReloadCount(f.pod, f.Namespace, f.KubeClientSet)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue