Skip to content

Commit

Permalink
Merge pull request noobaa#1443 from liranmauda/liran-update-to-ginkgo-v2
Browse files Browse the repository at this point in the history
CI | Update ginkgo to v2
  • Loading branch information
liranmauda authored Sep 18, 2024
2 parents 20c57d5 + 72f0a40 commit 5ffa9d3
Show file tree
Hide file tree
Showing 45 changed files with 109 additions and 85 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_admission_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
set -x
cd ./noobaa-operator
sudo bash .travis/install-minikube.sh
go get -v github.com/onsi/ginkgo/ginkgo
go install -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/ginkgo/v2
go install -v github.com/onsi/ginkgo/v2/ginkgo
ginkgo version
- name: Change settings for k8s and minikube
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_cosi_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
set -x
cd ./noobaa-operator
sudo bash .travis/install-minikube.sh
go get -v github.com/onsi/ginkgo/ginkgo
go install -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/ginkgo/v2
go install -v github.com/onsi/ginkgo/v2/ginkgo
ginkgo version
- name: Change settings for k8s and minikube
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_hac_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
run: |
set -x
bash .travis/install-5nodes-kind-cluster.sh
go get -v github.com/onsi/ginkgo/ginkgo
go install -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/ginkgo/v2
go install -v github.com/onsi/ginkgo/v2/ginkgo
ginkgo version
- name: Build NooBaa
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_kms_azure_vault_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
set -x
bash .travis/install-5nodes-kind-cluster.sh
go get -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/ginkgo/v2
go install -mod=mod -v github.com/onsi/ginkgo/ginkgo
ginkgo version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_kms_dev_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
set -x
bash .travis/install-5nodes-kind-cluster.sh
bash .travis/install-dev-vault.sh
go get -v github.com/onsi/ginkgo/ginkgo
go install -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/ginkgo/v2
go install -v github.com/onsi/ginkgo/v2/ginkgo
ginkgo version
- name: Build NooBaa
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_kms_ibm_kp_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
run: |
set -x
bash .travis/install-5nodes-kind-cluster.sh
go get -v github.com/onsi/ginkgo/ginkgo
go install -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/ginkgo/v2
go install -v github.com/onsi/ginkgo/v2/ginkgo
ginkgo version
- name: Build NooBaa
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_kms_kmip_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
run: |
set -x
bash .travis/install-5nodes-kind-cluster.sh
go get -v github.com/onsi/ginkgo/ginkgo
go install -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/ginkgo/v2
go install -v github.com/onsi/ginkgo/v2/ginkgo
ginkgo version
- name: Build NooBaa
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_kms_rotate_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
run: |
set -x
bash .travis/install-5nodes-kind-cluster.sh
go get -v github.com/onsi/ginkgo/ginkgo
go install -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/ginkgo/v2
go install -v github.com/onsi/ginkgo/v2/ginkgo
ginkgo version
- name: Build NooBaa
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_kms_tls_sa_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
bash .travis/install-5nodes-kind-cluster.sh
docker push $OPERATOR_IMAGE
bash .travis/install-tls-kms-noobaa.sh
go get -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/ginkgo/v2
go install -mod=mod -v github.com/onsi/ginkgo/ginkgo
ginkgo version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_kms_tls_token_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
bash .travis/install-5nodes-kind-cluster.sh
docker push $OPERATOR_IMAGE
bash .travis/install-tls-kms-noobaa.sh
go get -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/ginkgo/v2
go install -mod=mod -v github.com/onsi/ginkgo/ginkgo
ginkgo version
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1
github.com/libopenstorage/secrets v0.0.0-20240416031220-a17cf7f72c6c
github.com/marstr/randname v0.0.0-20200428202425-99aca53a2176
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.20.2
github.com/onsi/gomega v1.34.1
github.com/openshift/api v0.0.0-20240301093301-ce10821dc999
github.com/openshift/cloud-credential-operator v0.0.0-20231004191224-abdf0627a0cf
Expand Down Expand Up @@ -79,8 +79,10 @@ require (
github.com/go-errors/errors v1.5.1 // indirect
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/go-test/deep v1.1.0 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/vault/api/auth/kubernetes v0.6.0 // indirect
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.0 // indirect
Expand Down Expand Up @@ -171,7 +173,6 @@ require (
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/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/portworx/sched-ops v1.20.4-rc1.0.20220208024433-611d861089d4 // indirect
Expand Down Expand Up @@ -204,7 +205,6 @@ require (
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // 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
k8s.io/klog/v2 v2.130.1 // indirect
Expand Down
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ github.com/go-playground/validator/v10 v10.15.1 h1:BSe8uhN+xQ4r5guV/ywQI4gO59C2r
github.com/go-playground/validator/v10 v10.15.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
Expand Down Expand Up @@ -533,8 +532,8 @@ github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k=
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA=
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
Expand Down Expand Up @@ -822,8 +821,8 @@ github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8Ay
github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo=
github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw=
github.com/onsi/ginkgo/v2 v2.6.0/go.mod h1:63DOGlLAH8+REH8jUGdL3YpCpu7JODesutUjdENfUAc=
github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw=
github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI=
github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4=
github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
Expand Down
2 changes: 1 addition & 1 deletion pkg/admission/test/integ/admission_integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/noobaa/noobaa-operator/v5/pkg/options"
"github.com/noobaa/noobaa-operator/v5/pkg/system"
"github.com/noobaa/noobaa-operator/v5/pkg/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
Expand Down
8 changes: 5 additions & 3 deletions pkg/admission/test/integ/admission_suite_integ_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package admissionintegtests

import (
"context"
"log"
"os"
"testing"
"time"

"github.com/noobaa/noobaa-operator/v5/pkg/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -36,12 +38,12 @@ func connectToK8s() (*kubernetes.Clientset, error) {
return clientset, nil
}

var _ = BeforeSuite(func() {
var _ = BeforeSuite(func(ctx context.Context) {
By("Connecting to K8S cluster")
logger = log.New(GinkgoWriter, "INFO: ", log.Lshortfile)

var err error
clientset, err = connectToK8s()
Expect(err).ToNot(HaveOccurred())
Expect(clientset).ToNot(BeNil())
}, 60)
}, NodeTimeout(60*time.Second))
8 changes: 5 additions & 3 deletions pkg/admission/test/unit/admission_suite_unit_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package admissionunittests

import (
"context"
"log"
"testing"
"time"

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

Expand All @@ -15,6 +17,6 @@ func TestAdmission(t *testing.T) {
RunSpecs(t, "Admission Suite")
}

var _ = BeforeSuite(func() {
var _ = BeforeSuite(func(ctx context.Context) {
logger = log.New(GinkgoWriter, "INFO: ", log.Lshortfile)
}, 60)
}, NodeTimeout(60*time.Second))
2 changes: 1 addition & 1 deletion pkg/admission/test/unit/admission_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/noobaa/noobaa-operator/v5/pkg/bundle"
"github.com/noobaa/noobaa-operator/v5/pkg/util"
"github.com/noobaa/noobaa-operator/v5/pkg/validations"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/bucketclass/bucketclass_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package bucketclass_test
import (
"testing"

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/bucketclass/bucketclass_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package bucketclass

import (
nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
8 changes: 5 additions & 3 deletions pkg/controller/ha/ha_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package hac_test

import (
"context"
"log"
"os"
"testing"
"time"

"github.com/noobaa/noobaa-operator/v5/pkg/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -38,12 +40,12 @@ func connectToK8s() (*kubernetes.Clientset, error) {
return clientset, nil
}

var _ = BeforeSuite(func() {
var _ = BeforeSuite(func(ctx context.Context) {
By("Connecting to K8S cluster")
logger = log.New(GinkgoWriter, "INFO: ", log.Lshortfile)

var err error
clientset, err = connectToK8s()
Expect(err).ToNot(HaveOccurred())
Expect(clientset).ToNot(BeNil())
}, 60)
}, NodeTimeout(60*time.Second))
2 changes: 1 addition & 1 deletion pkg/controller/ha/hac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
9 changes: 5 additions & 4 deletions pkg/cosi/cosi_cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ package cosi

import (
"fmt"
"os"
"os/exec"
"strings"

nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1"
"github.com/noobaa/noobaa-operator/v5/pkg/bundle"
namespacestore "github.com/noobaa/noobaa-operator/v5/pkg/namespacestore"
"github.com/noobaa/noobaa-operator/v5/pkg/options"
"github.com/noobaa/noobaa-operator/v5/pkg/system"
"github.com/noobaa/noobaa-operator/v5/pkg/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"os"
"os/exec"
"strings"
)

var _ = Describe("COSI CLI tests", func() {
Expand Down
8 changes: 5 additions & 3 deletions pkg/cosi/cosi_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package cosi_test

import (
"context"
"log"
"os"
"testing"
"time"

"github.com/noobaa/noobaa-operator/v5/pkg/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/client-go/kubernetes"
)
Expand Down Expand Up @@ -35,12 +37,12 @@ func connectToK8s() (*kubernetes.Clientset, error) {
return clientset, nil
}

var _ = BeforeSuite(func() {
var _ = BeforeSuite(func(ctx context.Context) {
By("Connecting to K8S cluster")
logger = log.New(GinkgoWriter, "INFO: ", log.Lshortfile)

var err error
clientset, err = connectToK8s()
Expect(err).ToNot(HaveOccurred())
Expect(clientset).ToNot(BeNil())
}, 60)
}, NodeTimeout(60*time.Second))
2 changes: 1 addition & 1 deletion pkg/cosi/cosi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/noobaa/noobaa-operator/v5/pkg/options"
"github.com/noobaa/noobaa-operator/v5/pkg/system"
"github.com/noobaa/noobaa-operator/v5/pkg/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/obc/obc_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package obc_test
import (
"testing"

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/obc/obc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package obc

import (
nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/operator_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package operator_test
import (
"testing"

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/operator_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package operator

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

var _ = Describe("Operator Suite", func() {})
Loading

0 comments on commit 5ffa9d3

Please sign in to comment.