Skip to content

Commit

Permalink
Feat: upgrade to ginkgo v2 (#22)
Browse files Browse the repository at this point in the history
* Regenerate `go.mod` and vendor again, set min go version to go1.18.
* Use `github.com/onsi/ginkgo/v2` package everywhere.
* Replace deprecated `GinkgoParallelNode` with `GinkgoParallelProcess`.
* Update `Go / test` workflow to use ginkgo v2 CLI and flags.
  https://onsi.github.io/ginkgo/#recommended-continuous-integration-configuration.
  • Loading branch information
ctlong authored Jun 15, 2022
1 parent 23d9e22 commit 47e0e4f
Show file tree
Hide file tree
Showing 220 changed files with 25,254 additions and 53,456 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- run: go run github.com/onsi/ginkgo/ginkgo -r -p -race -randomizeAllSpecs -randomizeSuites
- run: go run github.com/onsi/ginkgo/v2/ginkgo -r --procs=3 --compilers=3 --randomize-all --randomize-suites --keep-going --race --trace
working-directory: src

vet:
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/leadership-election/app/agent_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package app_test
import (
"testing"

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

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/leadership-election/app/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"code.cloudfoundry.org/tlsconfig/certtest"
"github.com/onsi/gomega/types"

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

"code.cloudfoundry.org/system-metrics-scraper/cmd/leadership-election/app"
Expand All @@ -28,7 +28,7 @@ var _ = Describe("Agent", func() {
)

BeforeEach(func() {
run += GinkgoParallelNode() * 15
run += GinkgoParallelProcess() * 15

agents = make(map[string]*app.Agent)

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/metric-scraper/app/app_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package app_test
import (
"testing"

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

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/metric-scraper/app/metric_scraper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"code.cloudfoundry.org/tlsconfig"
"google.golang.org/grpc/credentials"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
"google.golang.org/grpc"
Expand Down
43 changes: 18 additions & 25 deletions src/go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module code.cloudfoundry.org/system-metrics-scraper

go 1.17
go 1.18

require (
code.cloudfoundry.org/go-envstruct v1.5.0
code.cloudfoundry.org/go-loggregator v0.0.0-20190813173818-049b6bf8152a // pinned
code.cloudfoundry.org/go-metric-registry v0.0.0-20200413202920-40d97c8804ec
code.cloudfoundry.org/tlsconfig v0.0.0-20200131000646-bbe0f8da39b3
code.cloudfoundry.org/go-metric-registry v0.0.0-20220601181753-a64f39ee2597
code.cloudfoundry.org/tlsconfig v0.0.0-20211123175040-23cc9f05b6b3
github.com/hashicorp/go-hclog v1.2.1
github.com/hashicorp/raft v1.3.9
github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d
github.com/onsi/ginkgo v1.16.5
github.com/nats-io/nats.go v1.16.0
github.com/onsi/ginkgo/v2 v2.1.4
github.com/onsi/gomega v1.19.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.34.0
Expand All @@ -19,43 +19,36 @@ require (
)

require (
code.cloudfoundry.org/go-diodes v0.0.0-20190809170250-f77fb823c7ee // indirect
code.cloudfoundry.org/rfc5424 v0.0.0-20180905210152-236a6d29298a // indirect
github.com/armon/go-metrics v0.3.3 // indirect
code.cloudfoundry.org/go-diodes v0.0.0-20220601181242-ac2da19efd60 // indirect
code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78 // indirect
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gogo/protobuf v1.3.2 // indirect; pinned
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/go-immutable-radix v1.2.0 // indirect
github.com/hashicorp/go-msgpack v1.1.5 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/nats-io/nats-server/v2 v2.7.4 // indirect
github.com/nats-io/nats-server/v2 v2.8.4 // indirect
github.com/nats-io/nkeys v0.3.0 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/square/certstrap v1.2.0 // indirect
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 // indirect
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.10 // indirect
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
)

require (
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/klauspost/compress v1.15.1 // indirect
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect
)
Loading

0 comments on commit 47e0e4f

Please sign in to comment.