Skip to content

Commit

Permalink
[release-0.64] ginkgo v2 (#1016)
Browse files Browse the repository at this point in the history
* foo

Signed-off-by: Quique Llorente <[email protected]>

* [0.64] Bump to ginkgo v2

Signed-off-by: Quique Llorente <[email protected]>
  • Loading branch information
qinqon authored Mar 21, 2022
1 parent e67755f commit fc36022
Show file tree
Hide file tree
Showing 559 changed files with 34,887 additions and 26,544 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ linters-settings:
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
stylecheck:
dot-import-whitelist: ["github.com/onsi/gomega", "github.com/onsi/ginkgo", "github.com/onsi/gomega/gstruct"]
dot-import-whitelist: ["github.com/onsi/gomega", "github.com/onsi/ginkgo/v2", "github.com/onsi/gomega/gstruct"]

linters:
disable-all: true
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ HANDLER_PULL_POLICY ?= Always
OPERATOR_PULL_POLICY ?= Always
export IMAGE_BUILDER ?= docker

WHAT ?= ./pkg ./controllers
WHAT ?= ./pkg/... ./controllers/...

unit_test_args ?= -r -keepGoing --randomizeAllSpecs --randomizeSuites --race --trace $(UNIT_TEST_ARGS)
unit_test_args ?= -r -keep-going --randomize-all --randomize-suites --race --trace $(UNIT_TEST_ARGS)

export KUBEVIRT_PROVIDER ?= k8s-1.21
export KUBEVIRT_NUM_NODES ?= 2 # 1 control-plane, 1 worker needed for e2e tests
export KUBEVIRT_NUM_SECONDARY_NICS ?= 2

export E2E_TEST_TIMEOUT ?= 80m

e2e_test_args = -v -timeout=$(E2E_TEST_TIMEOUT) -slowSpecThreshold=60 $(E2E_TEST_ARGS)
e2e_test_args = -v -timeout=$(E2E_TEST_TIMEOUT) --slow-spec-threshold=60s $(E2E_TEST_ARGS)

ifeq ($(findstring k8s,$(KUBEVIRT_PROVIDER)),k8s)
export PRIMARY_NIC ?= eth0
Expand All @@ -61,7 +61,7 @@ export KUBECTL ?= ./cluster/kubectl.sh
KUBECTL ?= ./cluster/kubectl.sh
OPERATOR_SDK ?= $(GOBIN)/operator-sdk

GINKGO = go run github.com/onsi/ginkgo/ginkgo
GINKGO = go run github.com/onsi/ginkgo/v2/ginkgo
CONTROLLER_GEN = go run sigs.k8s.io/controller-tools/cmd/controller-gen
OPM = go run -tags=json1 github.com/operator-framework/operator-registry/cmd/opm

Expand Down Expand Up @@ -156,16 +156,16 @@ push-operator: operator-manager
push: push-handler push-operator

test/unit/api:
cd api && $(GINKGO) $(unit_test_args) ./...
cd api && $(GINKGO) --junit-report=junit-api-unit-test.xml $(unit_test_args) ./...

test/unit: test/unit/api
NODE_NAME=node01 $(GINKGO) $(unit_test_args) $(WHAT)
NODE_NAME=node01 $(GINKGO) --junit-report=junit-pkg-controller-unit-test.xml $(unit_test_args) $(WHAT)

test-e2e-handler:
KUBECONFIG=$(KUBECONFIG) OPERATOR_NAMESPACE=$(OPERATOR_NAMESPACE) $(GINKGO) $(e2e_test_args) ./test/e2e/handler ... -- $(E2E_TEST_SUITE_ARGS)
KUBECONFIG=$(KUBECONFIG) OPERATOR_NAMESPACE=$(OPERATOR_NAMESPACE) $(GINKGO) $(e2e_test_args) ./test/e2e/handler ...

test-e2e-operator: manifests
KUBECONFIG=$(KUBECONFIG) OPERATOR_NAMESPACE=$(OPERATOR_NAMESPACE) $(GINKGO) $(e2e_test_args) ./test/e2e/operator ... -- $(E2E_TEST_SUITE_ARGS)
KUBECONFIG=$(KUBECONFIG) OPERATOR_NAMESPACE=$(OPERATOR_NAMESPACE) $(GINKGO) $(e2e_test_args) ./test/e2e/operator ...

test-e2e: test-e2e-operator test-e2e-handler

Expand Down
4 changes: 2 additions & 2 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/nmstate/kubernetes-nmstate/api
go 1.16

require (
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.15.0
github.com/onsi/ginkgo/v2 v2.1.3
github.com/onsi/gomega v1.17.0
golang.org/x/sys v0.0.0-20211013075003-97ac67df715c // indirect
golang.org/x/tools v0.1.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
Expand Down
8 changes: 7 additions & 1 deletion api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OI
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down Expand Up @@ -249,6 +251,7 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
Expand Down Expand Up @@ -336,13 +339,16 @@ github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k
github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E=
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc=
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
github.com/onsi/gomega v1.15.0 h1:WjP/FQ/sk43MRmnEcT+MlDw2TFvkrXlprrPST/IudjU=
github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0=
github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
Expand Down
7 changes: 2 additions & 5 deletions api/names/names_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ package names
import (
"testing"

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

"github.com/onsi/ginkgo/reporters"
)

func TestUnit(t *testing.T) {
RegisterFailHandler(Fail)
junitReporter := reporters.NewJUnitReporter("junit.controller-nodenetworkconfigurationpolicy-names-names_suite_test.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Names Test Suite", []Reporter{junitReporter})
RunSpecs(t, "Names Test Suite")
}
2 changes: 1 addition & 1 deletion api/names/names_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"reflect"

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

Expand Down
2 changes: 1 addition & 1 deletion api/shared/condition_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package shared
import (
"time"

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

corev1 "k8s.io/api/core/v1"
Expand Down
7 changes: 2 additions & 5 deletions api/shared/shared_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ package shared
import (
"testing"

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

"github.com/onsi/ginkgo/reporters"
)

func TestUnit(t *testing.T) {
RegisterFailHandler(Fail)
junitReporter := reporters.NewJUnitReporter("junit.apis-nmstate-shared-shared_suite_test.xml")
RunSpecsWithDefaultAndCustomReporters(t, "API Test Suite", []Reporter{junitReporter})
RunSpecs(t, "API Test Suite")
}
2 changes: 1 addition & 1 deletion api/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
package tools

import (
_ "github.com/onsi/ginkgo/ginkgo"
_ "github.com/onsi/ginkgo/v2/ginkgo"
_ "sigs.k8s.io/controller-tools/cmd/controller-gen"
)
2 changes: 1 addition & 1 deletion api/v1alpha1/nodenetworkstate_types_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1alpha1

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

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
7 changes: 2 additions & 5 deletions api/v1alpha1/v1alpha1_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ package v1alpha1
import (
"testing"

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

"github.com/onsi/ginkgo/reporters"
)

func TestUnit(t *testing.T) {
RegisterFailHandler(Fail)
junitReporter := reporters.NewJUnitReporter("junit.apis-nmstate-v1alpha1-v1alpha1_suite_test.xml")
RunSpecsWithDefaultAndCustomReporters(t, "API Test Suite", []Reporter{junitReporter})
RunSpecs(t, "API Test Suite")
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1beta1

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

corev1 "k8s.io/api/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/nodenetworkstate_types_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1beta1

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

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
7 changes: 2 additions & 5 deletions api/v1beta1/v1beta1_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ package v1beta1
import (
"testing"

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

"github.com/onsi/ginkgo/reporters"
)

func TestUnit(t *testing.T) {
RegisterFailHandler(Fail)
junitReporter := reporters.NewJUnitReporter("junit.apis-nmstate-v1beta1-v1beta1_suite_test.xml")
RunSpecsWithDefaultAndCustomReporters(t, "API Test Suite", []Reporter{junitReporter})
RunSpecs(t, "API Test Suite")
}
12 changes: 0 additions & 12 deletions api/vendor/github.com/fsnotify/fsnotify/.editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion api/vendor/github.com/fsnotify/fsnotify/.gitattributes

This file was deleted.

6 changes: 0 additions & 6 deletions api/vendor/github.com/fsnotify/fsnotify/.gitignore

This file was deleted.

36 changes: 0 additions & 36 deletions api/vendor/github.com/fsnotify/fsnotify/.travis.yml

This file was deleted.

52 changes: 0 additions & 52 deletions api/vendor/github.com/fsnotify/fsnotify/AUTHORS

This file was deleted.

Loading

0 comments on commit fc36022

Please sign in to comment.