Skip to content

Commit 06e84d9

Browse files
committed
Convert e2e go tests to ginkgo
1 parent 013aa09 commit 06e84d9

File tree

257 files changed

+195642
-9666
lines changed

Some content is hidden

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

257 files changed

+195642
-9666
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ require (
1212
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
1313
github.com/mikefarah/yq/v2 v2.4.1
1414
github.com/mitchellh/hashstructure v1.0.0
15+
github.com/onsi/ginkgo v1.10.1
16+
github.com/onsi/gomega v1.7.0
1517
github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible
1618
github.com/openshift/client-go v0.0.0-20190923180330-3b6373338c9b
1719
github.com/operator-framework/operator-registry v1.5.8

pkg/api/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package client
22

33
import (
4-
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
54
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/internalversion"
5+
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
66
"k8s.io/client-go/rest"
77
)
88

pkg/api/client/clientset/versioned/fake/decorator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NewReactionForwardingClientsetDecorator(objects []runtime.Object, options .
4848
// Swap out the embedded ReactionChain with a Reactor that reduces over the decorator's ReactionChain.
4949
decorator.ReactionChain = decorator.Clientset.ReactionChain
5050
decorator.Clientset.ReactionChain = []testing.Reactor{&testing.SimpleReactor{"*", "*", decorator.reduceReactions}}
51-
51+
5252
// Apply options
5353
for _, option := range options {
5454
option(decorator)

pkg/controller/operators/catalog/installplan_sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"k8s.io/apimachinery/pkg/labels"
1010
utilerrors "k8s.io/apimachinery/pkg/util/errors"
1111

12-
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/scoped"
1312
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
13+
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/scoped"
1414
)
1515

1616
// When a user adds permission to a ServiceAccount by creating or updating

pkg/controller/operators/olm/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (o *operatorConfig) validate() (err error) {
8181

8282
func defaultOperatorConfig() *operatorConfig {
8383
return &operatorConfig{
84-
resyncPeriod: queueinformer.ResyncWithJitter(30 * time.Second, 0.2),
84+
resyncPeriod: queueinformer.ResyncWithJitter(30*time.Second, 0.2),
8585
operatorNamespace: "default",
8686
watchedNamespaces: []string{metav1.NamespaceAll},
8787
clock: utilclock.RealClock{},

pkg/controller/operators/olm/operator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func NewFakeOperator(ctx context.Context, options ...fakeOperatorOption) (*Opera
258258
// Apply options to default config
259259
config := &fakeOperatorConfig{
260260
operatorConfig: &operatorConfig{
261-
resyncPeriod: queueinformer.ResyncWithJitter(5 * time.Minute, 0.1),
261+
resyncPeriod: queueinformer.ResyncWithJitter(5*time.Minute, 0.1),
262262
operatorNamespace: "default",
263263
watchedNamespaces: []string{metav1.NamespaceAll},
264264
clock: &utilclock.RealClock{},

pkg/controller/registry/reconciler/configmap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func validConfigMapCatalogSource(configMap *corev1.ConfigMap) *v1alpha1.CatalogS
170170
Name: "cool-catalog",
171171
Namespace: testNamespace,
172172
UID: types.UID("catalog-uid"),
173-
Labels: map[string]string{"olm.catalogSource": "cool-catalog"},
173+
Labels: map[string]string{"olm.catalogSource": "cool-catalog"},
174174
},
175175
Spec: v1alpha1.CatalogSourceSpec{
176176
ConfigMap: "cool-configmap",

pkg/controller/registry/reconciler/reconciler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func Pod(source *v1alpha1.CatalogSource, name string, image string, labels map[s
118118
},
119119
},
120120
InitialDelaySeconds: readinessDelay,
121-
TimeoutSeconds: 5,
121+
TimeoutSeconds: 5,
122122
},
123123
LivenessProbe: &v1.Probe{
124124
Handler: v1.Handler{

pkg/lib/comparison/equal_test.go

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ type equalitorWants struct {
1515
}
1616
type equalitorTest struct {
1717
description string
18-
args equalitorArgs
19-
wants equalitorWants
18+
args equalitorArgs
19+
wants equalitorWants
2020
}
2121

2222
var (
@@ -34,12 +34,12 @@ var (
3434
{
3535
description: "Structs/Exported/True",
3636
args: equalitorArgs{
37-
a: struct{
37+
a: struct {
3838
Animal string
3939
}{
4040
Animal: "hippo",
4141
},
42-
b: struct{
42+
b: struct {
4343
Animal string
4444
}{
4545
Animal: "hippo",
@@ -52,12 +52,12 @@ var (
5252
{
5353
description: "Structs/Exported/False",
5454
args: equalitorArgs{
55-
a: struct{
55+
a: struct {
5656
Animal string
5757
}{
5858
Animal: "hippo",
5959
},
60-
b: struct{
60+
b: struct {
6161
Animal string
6262
}{
6363
Animal: "meerkat",
@@ -110,13 +110,13 @@ var (
110110
{
111111
description: "Slices/Structs/Exported/Sequence/True",
112112
args: equalitorArgs{
113-
a: []struct{
113+
a: []struct {
114114
Animal string
115115
}{
116116
{Animal: "hippo"},
117117
{Animal: "meerkat"},
118118
},
119-
b: []struct{
119+
b: []struct {
120120
Animal string
121121
}{
122122
{Animal: "hippo"},
@@ -130,13 +130,13 @@ var (
130130
{
131131
description: "Slices/Structs/Exported/Sequence/False",
132132
args: equalitorArgs{
133-
a: []struct{
133+
a: []struct {
134134
Animal string
135135
}{
136136
{Animal: "hippo"},
137137
{Animal: "meerkat"},
138138
},
139-
b: []struct{
139+
b: []struct {
140140
Animal string
141141
}{
142142
{Animal: "meerkat"},
@@ -150,13 +150,13 @@ var (
150150
{
151151
description: "Slices/Structs/Exported/Sequence/LengthChange/False",
152152
args: equalitorArgs{
153-
a: []struct{
153+
a: []struct {
154154
Animal string
155155
}{
156156
{Animal: "hippo"},
157157
{Animal: "meerkat"},
158158
},
159-
b: []struct{
159+
b: []struct {
160160
Animal string
161161
}{
162162
{Animal: "hippo"},
@@ -171,7 +171,7 @@ var (
171171
{
172172
description: "Slice/Structs/Strings/MismatchedTypes/False",
173173
args: equalitorArgs{
174-
a: []struct{
174+
a: []struct {
175175
Animal string
176176
}{
177177
{Animal: "hippo"},
@@ -186,7 +186,7 @@ var (
186186
{
187187
description: "Struct/int/MismatchedTypes/False",
188188
args: equalitorArgs{
189-
a: struct{
189+
a: struct {
190190
Animal string
191191
}{
192192
Animal: "hippo",
@@ -200,7 +200,7 @@ var (
200200
{
201201
description: "Struct/nil/MismatchedTypes/False",
202202
args: equalitorArgs{
203-
a: struct{
203+
a: struct {
204204
Animal string
205205
}{
206206
Animal: "hippo",
@@ -215,11 +215,11 @@ var (
215215
description: "Map/Strings/True",
216216
args: equalitorArgs{
217217
a: map[string]int{
218-
"hippo": 64,
218+
"hippo": 64,
219219
"meerkat": 32,
220220
},
221221
b: map[string]int{
222-
"hippo": 64,
222+
"hippo": 64,
223223
"meerkat": 32,
224224
},
225225
},
@@ -231,12 +231,12 @@ var (
231231
description: "Map/Strings/Set/True",
232232
args: equalitorArgs{
233233
a: map[string]int{
234-
"hippo": 64,
234+
"hippo": 64,
235235
"meerkat": 32,
236236
},
237237
b: map[string]int{
238238
"meerkat": 32,
239-
"hippo": 64,
239+
"hippo": 64,
240240
},
241241
},
242242
wants: equalitorWants{
@@ -269,17 +269,17 @@ func TestNewHashEqualitor(t *testing.T) {
269269
{
270270
description: "Structs/Slices/NoSetTag/False",
271271
args: equalitorArgs{
272-
a: struct{
272+
a: struct {
273273
Animals []Animal
274-
}{
274+
}{
275275
Animals: []Animal{
276276
{Name: "hippo"},
277277
{Name: "meerkat"},
278278
},
279279
},
280-
b: struct{
280+
b: struct {
281281
Animals []Animal
282-
}{
282+
}{
283283
Animals: []Animal{
284284
{Name: "meerkat"},
285285
{Name: "hippo"},
@@ -293,17 +293,17 @@ func TestNewHashEqualitor(t *testing.T) {
293293
{
294294
description: "Structs/Slices/SetTag/True",
295295
args: equalitorArgs{
296-
a: struct{
296+
a: struct {
297297
Animals []Animal `hash:"set"`
298-
}{
298+
}{
299299
Animals: []Animal{
300300
{Name: "hippo"},
301301
{Name: "meerkat"},
302302
},
303303
},
304-
b: struct{
304+
b: struct {
305305
Animals []Animal `hash:"set"`
306-
}{
306+
}{
307307
Animals: []Animal{
308308
{Name: "meerkat"},
309309
{Name: "hippo"},
@@ -317,7 +317,7 @@ func TestNewHashEqualitor(t *testing.T) {
317317
{
318318
description: "Structs/Field/Changed/NoIgnoreTag/False",
319319
args: equalitorArgs{
320-
a: struct{
320+
a: struct {
321321
Animal
322322
Age int
323323
}{
@@ -326,7 +326,7 @@ func TestNewHashEqualitor(t *testing.T) {
326326
},
327327
Age: 27,
328328
},
329-
b: struct{
329+
b: struct {
330330
Animal
331331
Age int
332332
}{
@@ -343,7 +343,7 @@ func TestNewHashEqualitor(t *testing.T) {
343343
{
344344
description: "Structs/Field/Changed/IgnoreTag/True",
345345
args: equalitorArgs{
346-
a: struct{
346+
a: struct {
347347
Animal
348348
Age int `hash:"ignore"`
349349
}{
@@ -352,7 +352,7 @@ func TestNewHashEqualitor(t *testing.T) {
352352
},
353353
Age: 27,
354354
},
355-
b: struct{
355+
b: struct {
356356
Animal
357357
Age int `hash:"ignore"`
358358
}{

pkg/lib/operatorclient/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func NewClientFromRestConfig(config *rest.Config) (client ClientInterface, err e
174174
}
175175

176176
client = &Client{
177-
kubernetes,
177+
kubernetes,
178178
apiextensions,
179179
apiregistration,
180180
}

pkg/package-server/apiserver/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
genericapiserver "k8s.io/apiserver/pkg/server"
2222
"k8s.io/client-go/informers"
2323

24-
generatedopenapi "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/openapi"
2524
"github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apiserver/generic"
25+
generatedopenapi "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/openapi"
2626
"github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/version"
2727
)
2828

0 commit comments

Comments
 (0)