e2e framework: support Ginkgo decorators for framework.ConformanceIt

Additional parameters like ginkgo.SpecTimeout may also be relevant for
conformance tests.
This commit is contained in:
Patrick Ohly 2022-12-19 12:44:44 +01:00
parent a864583905
commit a51999e951
2 changed files with 7 additions and 5 deletions

View File

@ -529,11 +529,6 @@ func (kc *KubeConfig) FindCluster(name string) *KubeCluster {
return nil return nil
} }
// ConformanceIt is wrapper function for ginkgo It. Adds "[Conformance]" tag and makes static analysis easier.
func ConformanceIt(text string, body interface{}) bool {
return ginkgo.It(text+" [Conformance]", ginkgo.Offset(1), body)
}
// PodStateVerification represents a verification of pod state. // PodStateVerification represents a verification of pod state.
// Any time you have a set of pods that you want to operate against or query, // Any time you have a set of pods that you want to operate against or query,
// this struct can be used to declaratively identify those pods. // this struct can be used to declaratively identify those pods.

View File

@ -20,6 +20,7 @@ import (
"path" "path"
"reflect" "reflect"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/ginkgo/v2/types" "github.com/onsi/ginkgo/v2/types"
apierrors "k8s.io/apimachinery/pkg/api/errors" apierrors "k8s.io/apimachinery/pkg/api/errors"
@ -63,3 +64,9 @@ func AnnotatedLocationWithOffset(annotation string, offset int) types.CodeLocati
codeLocation = types.NewCustomCodeLocation(annotation + " | " + codeLocation.String()) codeLocation = types.NewCustomCodeLocation(annotation + " | " + codeLocation.String())
return codeLocation return codeLocation
} }
// ConformanceIt is wrapper function for ginkgo It. Adds "[Conformance]" tag and makes static analysis easier.
func ConformanceIt(text string, args ...interface{}) bool {
args = append(args, ginkgo.Offset(1))
return ginkgo.It(text+" [Conformance]", args...)
}