Skip to content

Commit 48a0740

Browse files
committed
test: Addition of ginkgo framework dependencies and TLS propagation test
1. For Ginkgo test framework support, ginkgo dependencies added 2. Test added to confirm that TLS propagation is applied correctly through controller-manager operator Signed-off-by: Kaleemullah Siddiqui <ksiddiqu@redhat.com>
1 parent 7634c41 commit 48a0740

299 files changed

Lines changed: 197273 additions & 161 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ GO_TEST_PACKAGES :=./pkg/... ./cmd/...
2020
$(call build-image,ocp-cluster-openshift-controller-manager-operator,$(IMAGE_REGISTRY)/ocp/4.3:cluster-openshift-controller-manager-operator,./Dockerfile,.)
2121

2222
test-e2e: GO_TEST_PACKAGES :=./test/e2e/...
23-
test-e2e: GO_TEST_FLAGS += -v -count=1
23+
test-e2e: GO_TEST_FLAGS += -v -count=1 -timeout 1h
2424
test-e2e: test-unit
2525
.PHONY: test-e2e

cmd/cluster-openshift-controller-manager-operator-tests-ext/main.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ package main
33
import (
44
"context"
55
"os"
6+
"time"
67

78
"github.com/spf13/cobra"
89
"k8s.io/component-base/cli"
910

1011
otecmd "github.com/openshift-eng/openshift-tests-extension/pkg/cmd"
1112
oteextension "github.com/openshift-eng/openshift-tests-extension/pkg/extension"
13+
oteginkgo "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
1214
"github.com/openshift/cluster-openshift-controller-manager-operator/pkg/version"
1315

16+
_ "github.com/openshift/cluster-openshift-controller-manager-operator/test/e2e"
17+
1418
"k8s.io/klog/v2"
1519
)
1620

@@ -48,6 +52,27 @@ func prepareOperatorTestsRegistry() *oteextension.Registry {
4852
registry := oteextension.NewRegistry()
4953
extension := oteextension.NewExtension("openshift", "payload", "cluster-openshift-controller-manager-operator")
5054

55+
// Build test specs from Ginkgo tests
56+
testSpecs, err := oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()
57+
if err != nil {
58+
klog.Fatalf("failed to build test specs: %v", err)
59+
}
60+
61+
testTimeout := 30 * time.Minute
62+
63+
// Register serial test suite for tests that must run serially
64+
serialSuite := oteextension.Suite{
65+
Name: "openshift/cluster-openshift-controller-manager-operator/operator/serial",
66+
Qualifiers: []string{
67+
`test.Name.Contains("[Serial]") && (test.Name.Contains("[Operator]") || test.Name.Contains("[TLS]") || test.Name.Contains("[Build]") || test.Name.Contains("[Image]"))`,
68+
},
69+
Parallelism: 1,
70+
TestTimeout: &testTimeout,
71+
}
72+
73+
extension.AddSuite(serialSuite)
74+
extension.AddSpecs(testSpecs)
75+
5176
registry.Register(extension)
5277
return registry
5378
}

go.mod

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ go 1.24.0
55
require (
66
github.com/ghodss/yaml v1.0.0
77
github.com/google/go-cmp v0.7.0
8+
github.com/onsi/ginkgo/v2 v2.21.0
9+
github.com/onsi/gomega v1.35.1
810
github.com/openshift-eng/openshift-tests-extension v0.0.0-20251125140340-13f4631a80b0
911
github.com/openshift/api v0.0.0-20260126183958-606bd613f9f7
1012
github.com/openshift/build-machinery-go v0.0.0-20251023084048-5d77c1a5e5af
@@ -41,12 +43,13 @@ require (
4143
github.com/go-openapi/jsonpointer v0.21.0 // indirect
4244
github.com/go-openapi/jsonreference v0.20.2 // indirect
4345
github.com/go-openapi/swag v0.23.0 // indirect
46+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
4447
github.com/gogo/protobuf v1.3.2 // indirect
4548
github.com/golang/protobuf v1.5.4 // indirect
4649
github.com/google/btree v1.1.3 // indirect
4750
github.com/google/cel-go v0.26.0 // indirect
4851
github.com/google/gnostic-models v0.7.0 // indirect
49-
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
52+
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect
5053
github.com/google/uuid v1.6.0 // indirect
5154
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
5255
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
@@ -87,15 +90,16 @@ require (
8790
go.uber.org/zap v1.27.0 // indirect
8891
go.yaml.in/yaml/v2 v2.4.2 // indirect
8992
go.yaml.in/yaml/v3 v3.0.4 // indirect
90-
golang.org/x/crypto v0.45.0 // indirect
93+
golang.org/x/crypto v0.47.0 // indirect
9194
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
92-
golang.org/x/net v0.47.0 // indirect
95+
golang.org/x/net v0.49.0 // indirect
9396
golang.org/x/oauth2 v0.30.0 // indirect
94-
golang.org/x/sync v0.18.0 // indirect
95-
golang.org/x/sys v0.38.0 // indirect
96-
golang.org/x/term v0.37.0 // indirect
97-
golang.org/x/text v0.31.0 // indirect
97+
golang.org/x/sync v0.19.0 // indirect
98+
golang.org/x/sys v0.40.0 // indirect
99+
golang.org/x/term v0.39.0 // indirect
100+
golang.org/x/text v0.33.0 // indirect
98101
golang.org/x/time v0.9.0 // indirect
102+
golang.org/x/tools v0.41.0 // indirect
99103
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
100104
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect
101105
google.golang.org/grpc v1.72.1 // indirect
@@ -117,3 +121,5 @@ require (
117121
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
118122
sigs.k8s.io/yaml v1.6.0 // indirect
119123
)
124+
125+
replace github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20251001123353-fd5b1fb35db1

go.sum

Lines changed: 91 additions & 19 deletions
Large diffs are not rendered by default.

test/e2e/main_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
package e2e_test
1+
package e2e
22

33
import (
44
"os"
55
"testing"
6-
)
76

8-
type devnullLogger struct{}
7+
"github.com/onsi/ginkgo/v2"
8+
"github.com/onsi/gomega"
9+
)
910

10-
func (_ devnullLogger) Logf(string, ...interface{}) {}
11+
func TestE2E(t *testing.T) {
12+
gomega.RegisterFailHandler(ginkgo.Fail)
13+
ginkgo.RunSpecs(t, "OpenShift Controller Manager Operator E2E Suite")
14+
}
1115

1216
func TestMain(m *testing.M) {
1317
os.Exit(m.Run())

0 commit comments

Comments
 (0)