Skip to content

Commit

Permalink
Merge pull request #1372 from harishsurf/ginkgo-e2e
Browse files Browse the repository at this point in the history
Convert e2e go tests to ginkgo - using ginkgo convert utility
  • Loading branch information
openshift-merge-robot committed Mar 20, 2020
2 parents 013aa09 + 06e84d9 commit a6162e4
Show file tree
Hide file tree
Showing 257 changed files with 195,642 additions and 9,666 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ require (
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
github.com/mikefarah/yq/v2 v2.4.1
github.com/mitchellh/hashstructure v1.0.0
github.com/onsi/ginkgo v1.10.1
github.com/onsi/gomega v1.7.0
github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible
github.com/openshift/client-go v0.0.0-20190923180330-3b6373338c9b
github.com/operator-framework/operator-registry v1.5.8
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/client/client.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package client

import (
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/internalversion"
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
"k8s.io/client-go/rest"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/api/client/clientset/versioned/fake/decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewReactionForwardingClientsetDecorator(objects []runtime.Object, options .
// Swap out the embedded ReactionChain with a Reactor that reduces over the decorator's ReactionChain.
decorator.ReactionChain = decorator.Clientset.ReactionChain
decorator.Clientset.ReactionChain = []testing.Reactor{&testing.SimpleReactor{"*", "*", decorator.reduceReactions}}

// Apply options
for _, option := range options {
option(decorator)
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/operators/catalog/installplan_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"k8s.io/apimachinery/pkg/labels"
utilerrors "k8s.io/apimachinery/pkg/util/errors"

"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/scoped"
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/scoped"
)

// When a user adds permission to a ServiceAccount by creating or updating
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/operators/olm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (o *operatorConfig) validate() (err error) {

func defaultOperatorConfig() *operatorConfig {
return &operatorConfig{
resyncPeriod: queueinformer.ResyncWithJitter(30 * time.Second, 0.2),
resyncPeriod: queueinformer.ResyncWithJitter(30*time.Second, 0.2),
operatorNamespace: "default",
watchedNamespaces: []string{metav1.NamespaceAll},
clock: utilclock.RealClock{},
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/operators/olm/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func NewFakeOperator(ctx context.Context, options ...fakeOperatorOption) (*Opera
// Apply options to default config
config := &fakeOperatorConfig{
operatorConfig: &operatorConfig{
resyncPeriod: queueinformer.ResyncWithJitter(5 * time.Minute, 0.1),
resyncPeriod: queueinformer.ResyncWithJitter(5*time.Minute, 0.1),
operatorNamespace: "default",
watchedNamespaces: []string{metav1.NamespaceAll},
clock: &utilclock.RealClock{},
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/registry/reconciler/configmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func validConfigMapCatalogSource(configMap *corev1.ConfigMap) *v1alpha1.CatalogS
Name: "cool-catalog",
Namespace: testNamespace,
UID: types.UID("catalog-uid"),
Labels: map[string]string{"olm.catalogSource": "cool-catalog"},
Labels: map[string]string{"olm.catalogSource": "cool-catalog"},
},
Spec: v1alpha1.CatalogSourceSpec{
ConfigMap: "cool-configmap",
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/registry/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func Pod(source *v1alpha1.CatalogSource, name string, image string, labels map[s
},
},
InitialDelaySeconds: readinessDelay,
TimeoutSeconds: 5,
TimeoutSeconds: 5,
},
LivenessProbe: &v1.Probe{
Handler: v1.Handler{
Expand Down
62 changes: 31 additions & 31 deletions pkg/lib/comparison/equal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ type equalitorWants struct {
}
type equalitorTest struct {
description string
args equalitorArgs
wants equalitorWants
args equalitorArgs
wants equalitorWants
}

var (
Expand All @@ -34,12 +34,12 @@ var (
{
description: "Structs/Exported/True",
args: equalitorArgs{
a: struct{
a: struct {
Animal string
}{
Animal: "hippo",
},
b: struct{
b: struct {
Animal string
}{
Animal: "hippo",
Expand All @@ -52,12 +52,12 @@ var (
{
description: "Structs/Exported/False",
args: equalitorArgs{
a: struct{
a: struct {
Animal string
}{
Animal: "hippo",
},
b: struct{
b: struct {
Animal string
}{
Animal: "meerkat",
Expand Down Expand Up @@ -110,13 +110,13 @@ var (
{
description: "Slices/Structs/Exported/Sequence/True",
args: equalitorArgs{
a: []struct{
a: []struct {
Animal string
}{
{Animal: "hippo"},
{Animal: "meerkat"},
},
b: []struct{
b: []struct {
Animal string
}{
{Animal: "hippo"},
Expand All @@ -130,13 +130,13 @@ var (
{
description: "Slices/Structs/Exported/Sequence/False",
args: equalitorArgs{
a: []struct{
a: []struct {
Animal string
}{
{Animal: "hippo"},
{Animal: "meerkat"},
},
b: []struct{
b: []struct {
Animal string
}{
{Animal: "meerkat"},
Expand All @@ -150,13 +150,13 @@ var (
{
description: "Slices/Structs/Exported/Sequence/LengthChange/False",
args: equalitorArgs{
a: []struct{
a: []struct {
Animal string
}{
{Animal: "hippo"},
{Animal: "meerkat"},
},
b: []struct{
b: []struct {
Animal string
}{
{Animal: "hippo"},
Expand All @@ -171,7 +171,7 @@ var (
{
description: "Slice/Structs/Strings/MismatchedTypes/False",
args: equalitorArgs{
a: []struct{
a: []struct {
Animal string
}{
{Animal: "hippo"},
Expand All @@ -186,7 +186,7 @@ var (
{
description: "Struct/int/MismatchedTypes/False",
args: equalitorArgs{
a: struct{
a: struct {
Animal string
}{
Animal: "hippo",
Expand All @@ -200,7 +200,7 @@ var (
{
description: "Struct/nil/MismatchedTypes/False",
args: equalitorArgs{
a: struct{
a: struct {
Animal string
}{
Animal: "hippo",
Expand All @@ -215,11 +215,11 @@ var (
description: "Map/Strings/True",
args: equalitorArgs{
a: map[string]int{
"hippo": 64,
"hippo": 64,
"meerkat": 32,
},
b: map[string]int{
"hippo": 64,
"hippo": 64,
"meerkat": 32,
},
},
Expand All @@ -231,12 +231,12 @@ var (
description: "Map/Strings/Set/True",
args: equalitorArgs{
a: map[string]int{
"hippo": 64,
"hippo": 64,
"meerkat": 32,
},
b: map[string]int{
"meerkat": 32,
"hippo": 64,
"hippo": 64,
},
},
wants: equalitorWants{
Expand Down Expand Up @@ -269,17 +269,17 @@ func TestNewHashEqualitor(t *testing.T) {
{
description: "Structs/Slices/NoSetTag/False",
args: equalitorArgs{
a: struct{
a: struct {
Animals []Animal
}{
}{
Animals: []Animal{
{Name: "hippo"},
{Name: "meerkat"},
},
},
b: struct{
b: struct {
Animals []Animal
}{
}{
Animals: []Animal{
{Name: "meerkat"},
{Name: "hippo"},
Expand All @@ -293,17 +293,17 @@ func TestNewHashEqualitor(t *testing.T) {
{
description: "Structs/Slices/SetTag/True",
args: equalitorArgs{
a: struct{
a: struct {
Animals []Animal `hash:"set"`
}{
}{
Animals: []Animal{
{Name: "hippo"},
{Name: "meerkat"},
},
},
b: struct{
b: struct {
Animals []Animal `hash:"set"`
}{
}{
Animals: []Animal{
{Name: "meerkat"},
{Name: "hippo"},
Expand All @@ -317,7 +317,7 @@ func TestNewHashEqualitor(t *testing.T) {
{
description: "Structs/Field/Changed/NoIgnoreTag/False",
args: equalitorArgs{
a: struct{
a: struct {
Animal
Age int
}{
Expand All @@ -326,7 +326,7 @@ func TestNewHashEqualitor(t *testing.T) {
},
Age: 27,
},
b: struct{
b: struct {
Animal
Age int
}{
Expand All @@ -343,7 +343,7 @@ func TestNewHashEqualitor(t *testing.T) {
{
description: "Structs/Field/Changed/IgnoreTag/True",
args: equalitorArgs{
a: struct{
a: struct {
Animal
Age int `hash:"ignore"`
}{
Expand All @@ -352,7 +352,7 @@ func TestNewHashEqualitor(t *testing.T) {
},
Age: 27,
},
b: struct{
b: struct {
Animal
Age int `hash:"ignore"`
}{
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/operatorclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func NewClientFromRestConfig(config *rest.Config) (client ClientInterface, err e
}

client = &Client{
kubernetes,
kubernetes,
apiextensions,
apiregistration,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/package-server/apiserver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
genericapiserver "k8s.io/apiserver/pkg/server"
"k8s.io/client-go/informers"

generatedopenapi "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/openapi"
"github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apiserver/generic"
generatedopenapi "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/openapi"
"github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/version"
)

Expand Down

0 comments on commit a6162e4

Please sign in to comment.