@@ -11,6 +11,7 @@ import (
11
11
"fmt"
12
12
"math/rand"
13
13
"os"
14
+ "strings"
14
15
"testing"
15
16
"time"
16
17
@@ -21,6 +22,8 @@ import (
21
22
// directory contains a Ginkgo test suite.
22
23
// See https://github.com/kubernetes/kubernetes/issues/74827
23
24
// "github.com/onsi/ginkgo/v2"
25
+ "github.com/onsi/ginkgo/v2"
26
+ "github.com/onsi/ginkgo/v2/types"
24
27
25
28
corev1 "k8s.io/api/core/v1"
26
29
kclientset "k8s.io/client-go/kubernetes"
@@ -34,7 +37,7 @@ import (
34
37
"k8s.io/kubernetes/test/utils/image"
35
38
36
39
// Ensure test annotation
37
- _ "k8s.io/kubernetes/openshift-hack/e2e/annotate/generated"
40
+ "k8s.io/kubernetes/openshift-hack/e2e/annotate/generated"
38
41
)
39
42
40
43
func TestMain (m * testing.M ) {
@@ -106,5 +109,18 @@ func TestMain(m *testing.M) {
106
109
}
107
110
108
111
func TestE2E (t * testing.T ) {
112
+ // TODO(soltysh): this is raw copy from end of openshift-hack/e2e/annotate/generated/zz_generated.annotations.go
113
+ // https://issues.redhat.com/browse/OCPBUGS-25641
114
+ ginkgo .GetSuite ().SetAnnotateFn (func (name string , node types.TestSpec ) {
115
+ if newLabels , ok := generated .Annotations [name ]; ok {
116
+ node .AppendText (newLabels )
117
+ } else {
118
+ panic (fmt .Sprintf ("unable to find test %s" , name ))
119
+ }
120
+ if strings .Contains (name , "Kubectl client Kubectl prune with applyset should apply and prune objects" ) {
121
+ fmt .Printf ("Trying to annotate %q\n " , name )
122
+ }
123
+ })
124
+
109
125
e2e .RunE2ETests (t )
110
126
}
0 commit comments