Skip to content

Commit

Permalink
update ginkgo to v2
Browse files Browse the repository at this point in the history
update to version 2 of ginkgo so that we can take advantage of
improvements that have been made

The only changes that where required by our testing was that three calls
to ginkgo.By() that where placed improperly where removed.

two in TestBatch() and one in runTestCase(), both of these are not
ginkgo tests and it should have no effect on them

Signed-off-by: Jacob Tanenbaum <[email protected]>
  • Loading branch information
JacobTanenbaum authored and jcaamano committed Oct 18, 2024
1 parent 1e4d8ea commit cc3c784
Show file tree
Hide file tree
Showing 346 changed files with 25,847 additions and 8,952 deletions.
6 changes: 3 additions & 3 deletions go-controller/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
github.com/mdlayher/ndp v1.0.1
github.com/miekg/dns v1.1.31
github.com/mitchellh/copystructure v1.2.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.17.1
github.com/onsi/gomega v1.32.0
github.com/openshift/api v0.0.0-20231120222239-b86761094ee3
github.com/openshift/client-go v0.0.0-20231121143148-910ca30a1a9a
Expand Down Expand Up @@ -79,11 +79,13 @@ require (
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand All @@ -102,7 +104,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/openshift/custom-resource-status v1.1.2 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand All @@ -126,7 +127,6 @@ require (
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go-controller/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,6 @@ github.com/openshift/client-go v0.0.0-20231121143148-910ca30a1a9a h1:4FVrw8hz0Wb
github.com/openshift/client-go v0.0.0-20231121143148-910ca30a1a9a/go.mod h1:arApQobmOjZqtxw44TwnQdUCH+t9DgZ8geYPFqksHws=
github.com/openshift/custom-resource-status v1.1.2 h1:C3DL44LEbvlbItfd8mT5jWrqPfHnSOQoQf/sypqA6A4=
github.com/openshift/custom-resource-status v1.1.2/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA=
github.com/ovn-org/libovsdb v0.6.1-0.20240125124854-03f787b1a892 h1:/yg3/z+RH+iDLMxp6FTnmlk5bStK542/Rge5EBjnA9A=
github.com/ovn-org/libovsdb v0.6.1-0.20240125124854-03f787b1a892/go.mod h1:LC5DOvcY58jOG3HTvDyCVidoMJDurPeu+xlxv5Krd9Q=
github.com/ovn-org/libovsdb v0.7.1-0.20240820095311-ce1951614a20 h1:OoDvzyaK7F/ZANIIFOgb4Haj7mye3Hle0fYZZNdidSs=
github.com/ovn-org/libovsdb v0.7.1-0.20240820095311-ce1951614a20/go.mod h1:dJbxEaalQl83nn904K32FaMjlH/qOObZ0bj4ejQ78AI=
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package controller
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/vishvananda/netlink"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
iputils "github.com/containernetworking/plugins/pkg/ip"
"github.com/vishvananda/netlink"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/allocator/ip/subnet/allocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
ipam "github.com/ovn-org/ovn-kubernetes/go-controller/pkg/allocator/ip"
ovntest "github.com/ovn-org/ovn-kubernetes/go-controller/pkg/testing"

"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package clustermanager
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/clustermanager/clustermanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/fake"

"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"

hotypes "github.com/ovn-org/ovn-kubernetes/go-controller/hybrid-overlay/pkg/types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dnsnameresolver
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"time"

"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
ocpnetworkapiv1alpha1 "github.com/openshift/api/network/v1alpha1"
ocpnetworklisterv1alpha1 "github.com/openshift/client-go/network/listers/network/v1alpha1"
Expand Down
44 changes: 21 additions & 23 deletions go-controller/pkg/clustermanager/egressip_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"net"
"time"

"github.com/onsi/ginkgo/extensions/table"

"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
ocpcloudnetworkapi "github.com/openshift/api/cloudnetwork/v1"
ocpconfigapi "github.com/openshift/api/config/v1"
Expand Down Expand Up @@ -279,7 +277,7 @@ var _ = ginkgo.Describe("OVN cluster-manager EgressIP Operations", func() {
})

ginkgo.Context("On node ADD/UPDATE/DELETE", func() {
table.DescribeTable("should re-assign EgressIPs and perform proper egressIP allocation changes", func(egressIP, expectedNetwork string) {
ginkgo.DescribeTable("should re-assign EgressIPs and perform proper egressIP allocation changes", func(egressIP, expectedNetwork string) {
app.Action = func(ctx *cli.Context) error {
node1IPv4OVN := "192.168.126.202/24"
node1IPv4SecondaryHost := "10.10.10.3/24"
Expand Down Expand Up @@ -393,13 +391,13 @@ var _ = ginkgo.Describe("OVN cluster-manager EgressIP Operations", func() {
app.Name,
})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}, table.Entry("OVN network", "192.168.126.101", "192.168.126.0/24"),
table.Entry("Secondary host network", "10.10.10.100", "10.10.10.0/24"),
table.Entry("Secondary host network", "7.7.7.100", "7.7.0.0/16"),
table.Entry("Secondary host network", "7.7.8.100", "7.7.0.0/16"),
}, ginkgo.Entry("OVN network", "192.168.126.101", "192.168.126.0/24"),
ginkgo.Entry("Secondary host network", "10.10.10.100", "10.10.10.0/24"),
ginkgo.Entry("Secondary host network", "7.7.7.100", "7.7.0.0/16"),
ginkgo.Entry("Secondary host network", "7.7.8.100", "7.7.0.0/16"),
)

table.DescribeTable("should re-assign EgressIPs and perform proper egressIP allocation changes during node deletion", func(egressIP, expectedNetwork string) {
ginkgo.DescribeTable("should re-assign EgressIPs and perform proper egressIP allocation changes during node deletion", func(egressIP, expectedNetwork string) {
app.Action = func(ctx *cli.Context) error {
node1IPv4OVN := "192.168.126.202/24"
node1IPv4SecondaryHost := "10.10.10.3/24"
Expand Down Expand Up @@ -511,10 +509,10 @@ var _ = ginkgo.Describe("OVN cluster-manager EgressIP Operations", func() {

err := app.Run([]string{app.Name})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}, table.Entry("OVN network", "192.168.126.101", "192.168.126.0/24"),
table.Entry("Secondary host network", "10.10.10.100", "10.10.10.0/24"),
table.Entry("Secondary host network", "7.7.7.100", "7.7.0.0/16"),
table.Entry("Secondary host network", "7.7.8.100", "7.7.0.0/16"),
}, ginkgo.Entry("OVN network", "192.168.126.101", "192.168.126.0/24"),
ginkgo.Entry("Secondary host network", "10.10.10.100", "10.10.10.0/24"),
ginkgo.Entry("Secondary host network", "7.7.7.100", "7.7.0.0/16"),
ginkgo.Entry("Secondary host network", "7.7.8.100", "7.7.0.0/16"),
)
ginkgo.It("should assign EgressIPs to a linux node when there are windows nodes in the cluster", func() {
app.Action = func(ctx *cli.Context) error {
Expand Down Expand Up @@ -1748,7 +1746,7 @@ var _ = ginkgo.Describe("OVN cluster-manager EgressIP Operations", func() {
gomega.Expect(err).NotTo(gomega.HaveOccurred())
})

table.DescribeTable("should be able to allocate several EgressIPs and avoid the same node", func(egressIP1, egressIP2 string) {
ginkgo.DescribeTable("should be able to allocate several EgressIPs and avoid the same node", func(egressIP1, egressIP2 string) {
app.Action = func(ctx *cli.Context) error {
node1IPv4OVN := ""
node1IPv6OVN := "0:0:0:0:0:feff:c0a8:8e0c/64"
Expand Down Expand Up @@ -1829,11 +1827,11 @@ var _ = ginkgo.Describe("OVN cluster-manager EgressIP Operations", func() {

err := app.Run([]string{app.Name})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}, table.Entry("OVN egress IPs", "0:0:0:0:0:feff:c0a8:8e0d", "0:0:0:0:0:feff:c0a8:8e0f"),
table.Entry("Secondary host egress IPs", "0:0:1:0:0:fecf:c0a8:8e0d", "0:0:1:0:0:febf:c0a8:8e0f"),
table.Entry("OVN and secondary host egress IPs", "0:0:1:0:0:fecf:c0a8:8e0d", "0:0:0:0:0:feff:c0a8:8e0f"))
}, ginkgo.Entry("OVN egress IPs", "0:0:0:0:0:feff:c0a8:8e0d", "0:0:0:0:0:feff:c0a8:8e0f"),
ginkgo.Entry("Secondary host egress IPs", "0:0:1:0:0:fecf:c0a8:8e0d", "0:0:1:0:0:febf:c0a8:8e0f"),
ginkgo.Entry("OVN and secondary host egress IPs", "0:0:1:0:0:fecf:c0a8:8e0d", "0:0:0:0:0:feff:c0a8:8e0f"))

table.DescribeTable("should be able to allocate several EgressIPs and avoid the same node and leave one un-assigned without error", func(egressIP1, egressIP2, egressIP3 string) {
ginkgo.DescribeTable("should be able to allocate several EgressIPs and avoid the same node and leave one un-assigned without error", func(egressIP1, egressIP2, egressIP3 string) {
app.Action = func(ctx *cli.Context) error {
node1IPv4OVN := ""
node1IPv6OVN := "0:0:0:0:0:feff:c0a8:8e0c/64"
Expand Down Expand Up @@ -1917,8 +1915,8 @@ var _ = ginkgo.Describe("OVN cluster-manager EgressIP Operations", func() {

err := app.Run([]string{app.Name})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}, table.Entry("OVN network", "0:0:0:0:0:feff:c0a8:8e0d", "0:0:0:0:0:feff:c0a8:8e0e", "0:0:0:0:0:feff:c0a8:8e0f"),
table.Entry("Secondary host network", "0:0:1:0:0:feff:c0a8:8e0d", "0:0:1:0:0:feff:c0a8:8e0e", "0:0:1:0:0:feff:c0a8:8e0f"),
}, ginkgo.Entry("OVN network", "0:0:0:0:0:feff:c0a8:8e0d", "0:0:0:0:0:feff:c0a8:8e0e", "0:0:0:0:0:feff:c0a8:8e0f"),
ginkgo.Entry("Secondary host network", "0:0:1:0:0:feff:c0a8:8e0d", "0:0:1:0:0:feff:c0a8:8e0e", "0:0:1:0:0:feff:c0a8:8e0f"),
)

ginkgo.It("should be able to allocate several EgressIPs for OVN and Secondary host networks and avoid the same node and leave multiple EgressIPs un-assigned without error", func() {
Expand Down Expand Up @@ -2013,7 +2011,7 @@ var _ = ginkgo.Describe("OVN cluster-manager EgressIP Operations", func() {
gomega.Expect(err).NotTo(gomega.HaveOccurred())
})

table.DescribeTable("should return the already allocated IP with the same node if it is allocated again", func(egressIP string) {
ginkgo.DescribeTable("should return the already allocated IP with the same node if it is allocated again", func(egressIP string) {
app.Action = func(ctx *cli.Context) error {
node1IPv4OVN := ""
node1IPv6OVN := "0:0:0:0:0:feff:c0a8:8e0c/64"
Expand Down Expand Up @@ -2096,8 +2094,8 @@ var _ = ginkgo.Describe("OVN cluster-manager EgressIP Operations", func() {

err := app.Run([]string{app.Name})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}, table.Entry("OVN network", "0:0:0:0:0:feff:c0a8:8e1a"),
table.Entry("Secondary host network", "0:0:1:0:0:feff:c0a8:8e0d"),
}, ginkgo.Entry("OVN network", "0:0:0:0:0:feff:c0a8:8e1a"),
ginkgo.Entry("Secondary host network", "0:0:1:0:0:feff:c0a8:8e0d"),
)

ginkgo.It("should not be able to allocate node IP", func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"reflect"
"time"

"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/config"
egressserviceapi "github.com/ovn-org/ovn-kubernetes/go-controller/pkg/crd/egressservice/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package endpointslicemirror
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
"github.com/urfave/cli/v2"
v1 "k8s.io/api/core/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"
"sync"

"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
"github.com/urfave/cli/v2"
v1 "k8s.io/api/core/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"

"github.com/containernetworking/cni/pkg/types"
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
"github.com/urfave/cli/v2"
v1 "k8s.io/api/core/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package status_manager
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"sync/atomic"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
. "github.com/onsi/gomega"
clienttesting "k8s.io/client-go/testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package zone_tracker
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package zone_tracker
import (
"context"
"fmt"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"sync/atomic"
"time"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package userdefinednetwork
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"fmt"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

corev1 "k8s.io/api/core/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package template
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package template

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/cni/cni_dpu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

cnitypes "github.com/containernetworking/cni/pkg/types"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/cni/types"
kubeMocks "github.com/ovn-org/ovn-kubernetes/go-controller/pkg/kube/mocks"
Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/cni/cni_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cni
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/cni/cni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

cnitypes "github.com/containernetworking/cni/pkg/types"
Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/cni/ovs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

ovntest "github.com/ovn-org/ovn-kubernetes/go-controller/pkg/testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/cni/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/stretchr/testify/mock"

Expand Down
Loading

0 comments on commit cc3c784

Please sign in to comment.