Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): update to ginkgo v2 #16

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ require (
github.com/evanphx/json-patch v5.6.0+incompatible
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side note: should we update the module name to be?

module github.com/mesosphere/kubefed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see no harm in doing that (apart from all the refactoring thats needed in kommander repo) but also, there is no real upside (aesthetics aside). we want to get rid of kubefed eventually anyway so maybe this is fine 🙈

github.com/json-iterator/go v1.1.12
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.27.7
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
github.com/pborman/uuid v1.2.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.15.1
github.com/spf13/cobra v1.6.1
github.com/prometheus/client_golang v1.16.0
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.2
golang.org/x/text v0.9.0
k8s.io/api v0.27.2
k8s.io/apiextensions-apiserver v0.27.2
k8s.io/apimachinery v0.27.2
k8s.io/apiserver v0.27.2
k8s.io/client-go v0.27.2
k8s.io/component-base v0.27.2
k8s.io/klog/v2 v2.90.1
github.com/stretchr/testify v1.8.4
golang.org/x/text v0.11.0
k8s.io/api v0.27.4
k8s.io/apiextensions-apiserver v0.27.4
k8s.io/apimachinery v0.27.4
k8s.io/apiserver v0.27.4
k8s.io/client-go v0.27.4
k8s.io/component-base v0.27.4
k8s.io/klog/v2 v2.100.1
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
k8s.io/kubectl v0.26.3
k8s.io/kubectl v0.27.4
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/controller-runtime v0.15.1
sigs.k8s.io/yaml v1.3.0
Expand Down Expand Up @@ -51,30 +51,31 @@ require (
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // 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.3 // indirect
github.com/google/cel-go v0.12.6 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
go.etcd.io/etcd/api/v3 v3.5.7 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect
Expand All @@ -92,20 +93,20 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd // indirect
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 // indirect
Expand Down
119 changes: 50 additions & 69 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/apis/core/v1beta1/kubefedcluster_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1beta1
import (
"context"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down
8 changes: 3 additions & 5 deletions pkg/apis/core/v1beta1/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"path/filepath"
"testing"

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

"k8s.io/client-go/kubernetes/scheme"
Expand All @@ -24,7 +24,7 @@ func TestAPIs(t *testing.T) {
RunSpecs(t, "v1beta1 Suite")
}

var _ = BeforeSuite(func(done Done) {
var _ = BeforeSuite(func() {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))

By("bootstrapping test environment")
Expand All @@ -47,9 +47,7 @@ var _ = BeforeSuite(func(done Done) {
k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
Expect(err).ToNot(HaveOccurred())
Expect(k8sClient).ToNot(BeNil())

close(done)
}, 60)
})

var _ = AfterSuite(func() {
By("tearing down the test environment")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"testing"
"time"

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

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -53,7 +53,7 @@ var cc *ClusterController
var stopControllerCh chan struct{}
var config *util.ClusterHealthCheckConfig

var _ = BeforeSuite(func(done Done) {
var _ = BeforeSuite(func() {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))

testenv = &envtest.Environment{
Expand Down Expand Up @@ -109,9 +109,7 @@ var _ = BeforeSuite(func(done Done) {
Expect(err).ToNot(HaveOccurred())

cc.Run(stopControllerCh)

close(done)
}, 60)
})

var _ = AfterSuite(func() {
close(stopControllerCh)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubefedctl/join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"net/http/httputil"
"net/url"

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

corev1 "k8s.io/api/core/v1"
Expand Down
8 changes: 3 additions & 5 deletions pkg/kubefedctl/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"path/filepath"
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -44,7 +44,7 @@ func TestKubefedCTL(t *testing.T) {
RunSpecs(t, "Kubefedctl Suite")
}

var _ = BeforeSuite(func(done Done) {
var _ = BeforeSuite(func() {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))

testEnv = &envtest.Environment{
Expand All @@ -69,9 +69,7 @@ var _ = BeforeSuite(func(done Done) {
k8sClient, err = client.New(cfg, client.Options{Scheme: clientScheme})
Expect(err).ToNot(HaveOccurred())
Expect(k8sClient).ToNot(BeNil())

close(done)
}, 60)
})

var _ = AfterSuite(func() {
By("tearing down the test environment")
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"sigs.k8s.io/kubefed/test/common"
"sigs.k8s.io/kubefed/test/e2e/framework"

. "github.com/onsi/ginkgo" //nolint:stylecheck
. "github.com/onsi/ginkgo/v2" //nolint:stylecheck
)

var _ = Describe("Federated CRD resources", func() {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"sigs.k8s.io/kubefed/test/common"
"sigs.k8s.io/kubefed/test/e2e/framework"

. "github.com/onsi/ginkgo" //nolint:stylecheck
. "github.com/onsi/ginkgo/v2" //nolint:stylecheck
)

var containedTypeNames = []string{"jobs.batch", "deployments.apps", "replicasets.apps"}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/defaulting.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"sigs.k8s.io/kubefed/pkg/features"
"sigs.k8s.io/kubefed/test/e2e/framework"

. "github.com/onsi/ginkgo" //nolint:stylecheck
. "github.com/onsi/ginkgo/v2" //nolint:stylecheck
)

var _ = Describe("Default", func() {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/deleteoptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package e2e

import (
. "github.com/onsi/ginkgo" //nolint:stylecheck
. "github.com/onsi/ginkgo/v2" //nolint:stylecheck
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

Expand Down
18 changes: 8 additions & 10 deletions test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,21 @@ package e2e
import (
"testing"

. "github.com/onsi/ginkgo/v2" //nolint:stylecheck
. "github.com/onsi/gomega" //nolint:stylecheck
"k8s.io/klog/v2"

"sigs.k8s.io/kubefed/test/e2e/framework"
"sigs.k8s.io/kubefed/test/e2e/framework/ginkgowrapper"

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

// RunE2ETests checks configuration parameters (specified through flags) and then runs
// E2E tests using the Ginkgo runner.
// This function is called on each Ginkgo node in parallel mode.
func RunE2ETests(t *testing.T) {
gomega.RegisterFailHandler(ginkgowrapper.Fail)
klog.Infof("Starting e2e run %q on Ginkgo node %d", framework.RunID, config.GinkgoConfig.ParallelNode)
ginkgo.RunSpecs(t, "KubeFed e2e suite")
RegisterFailHandler(Fail)
config, _ := GinkgoConfiguration()
klog.Infof("Starting e2e run %q on Ginkgo node %d", framework.RunID, config.ParallelHost)
RunSpecs(t, "KubeFed e2e suite")
}

// There are certain operations we only want to run once per overall test invocation
Expand All @@ -46,7 +44,7 @@ func RunE2ETests(t *testing.T) {
// This function takes two parameters: one function which runs on only the first Ginkgo node,
// returning an opaque byte array, and then a second function which runs on all Ginkgo nodes,
// accepting the byte array.
var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
var _ = SynchronizedBeforeSuite(func() []byte {
// Run only on Ginkgo node 1

// Some tests require simulated federation and will initialize an
Expand Down Expand Up @@ -75,7 +73,7 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
// Similar to SynchornizedBeforeSuite, we want to run some operations only once (such as collecting cluster logs).
// Here, the order of functions is reversed; first, the function which runs everywhere,
// and then the function that only runs on the first Ginkgo node.
var _ = ginkgo.SynchronizedAfterSuite(func() {
var _ = SynchronizedAfterSuite(func() {
// Run on all Ginkgo nodes
framework.Logf("Running AfterSuite actions on all node")
framework.RunCleanupActions()
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/federate.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"sigs.k8s.io/kubefed/test/common"
"sigs.k8s.io/kubefed/test/e2e/framework"

. "github.com/onsi/ginkgo" //nolint:stylecheck
. "github.com/onsi/ginkgo/v2" //nolint:stylecheck
)

type testResources struct {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import (
"sigs.k8s.io/kubefed/pkg/controller/util"
"sigs.k8s.io/kubefed/test/common"

. "github.com/onsi/ginkgo" //nolint:stylecheck
. "github.com/onsi/gomega" //nolint:stylecheck
. "github.com/onsi/ginkgo/v2" //nolint:stylecheck
. "github.com/onsi/gomega" //nolint:stylecheck
)

// TODO(marun) Replace the framework with the unmanaged
Expand Down
Loading
Loading