From 916b501bff94d56f91f0732a915a97e051c3d89d Mon Sep 17 00:00:00 2001 From: Brian Cunnie Date: Fri, 31 Dec 2021 11:19:34 -0800 Subject: [PATCH] =?UTF-8?q?Bump=20Ginkgo=20v1.16.5=20=E2=86=92=20v2.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ginkgo v2.0.0 is hot off the press, released yesterday. Let's upgrade! - `extensions/table` no longer needs to be separately imported - `BeforeSuite()` must be outermost fixes: ``` It looks like you are trying to add a [BeforeSuite] node within a container ``` ``` imported and not used: "github.com/onsi/ginkgo/v2/extensions/table" ``` ``` Entry redeclared during import "github.com/onsi/ginkgo/extensions/table" ``` --- bosh-release/src/sslip.io-dns-server/go.mod | 5 +- bosh-release/src/sslip.io-dns-server/go.sum | 11 ++++- .../integration_suite_test.go | 2 +- .../sslip.io-dns-server/integration_test.go | 46 +++++++++---------- .../sslip.io-dns-server/xip/xip_suite_test.go | 2 +- .../src/sslip.io-dns-server/xip/xip_test.go | 3 +- 6 files changed, 36 insertions(+), 33 deletions(-) diff --git a/bosh-release/src/sslip.io-dns-server/go.mod b/bosh-release/src/sslip.io-dns-server/go.mod index 31b1e33..922447b 100644 --- a/bosh-release/src/sslip.io-dns-server/go.mod +++ b/bosh-release/src/sslip.io-dns-server/go.mod @@ -3,7 +3,7 @@ module xip go 1.17 require ( - github.com/onsi/ginkgo v1.16.5 + github.com/onsi/ginkgo/v2 v2.0.0 github.com/onsi/gomega v1.17.0 go.etcd.io/etcd/client/v3 v3.5.1 golang.org/x/net v0.0.0-20211216030914-fe4d6282115f @@ -12,10 +12,8 @@ require ( require ( github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/nxadm/tail v1.4.8 // indirect go.etcd.io/etcd/api/v3 v3.5.1 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.1 // indirect go.uber.org/atomic v1.7.0 // indirect @@ -26,6 +24,5 @@ require ( google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect google.golang.org/grpc v1.38.0 // indirect google.golang.org/protobuf v1.26.0 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/bosh-release/src/sslip.io-dns-server/go.sum b/bosh-release/src/sslip.io-dns-server/go.sum index 2c649d2..f38a3b1 100644 --- a/bosh-release/src/sslip.io-dns-server/go.sum +++ b/bosh-release/src/sslip.io-dns-server/go.sum @@ -12,6 +12,9 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -70,10 +73,12 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -102,9 +107,10 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +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 v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= 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.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= @@ -210,6 +216,7 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/bosh-release/src/sslip.io-dns-server/integration_suite_test.go b/bosh-release/src/sslip.io-dns-server/integration_suite_test.go index 0126862..ddc56be 100644 --- a/bosh-release/src/sslip.io-dns-server/integration_suite_test.go +++ b/bosh-release/src/sslip.io-dns-server/integration_suite_test.go @@ -3,7 +3,7 @@ package main_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/bosh-release/src/sslip.io-dns-server/integration_test.go b/bosh-release/src/sslip.io-dns-server/integration_test.go index 4846a5d..1d07422 100644 --- a/bosh-release/src/sslip.io-dns-server/integration_test.go +++ b/bosh-release/src/sslip.io-dns-server/integration_test.go @@ -5,40 +5,40 @@ import ( "strings" "time" - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" . "github.com/onsi/gomega/gexec" ) +var err error +var serverCmd *exec.Cmd +var serverSession *Session + +var _ = BeforeSuite(func() { + serverPath, err := Build("main.go") + Expect(err).ToNot(HaveOccurred()) + serverCmd = exec.Command(serverPath) + serverSession, err = Start(serverCmd, GinkgoWriter, GinkgoWriter) + // TODO: bind to unprivileged port (NOT 53) for non-macOS users (e.g. port 35353) + Expect(err).ToNot(HaveOccurred()) + // takes 0.455s to start up on macOS Big Sur 3.7 GHz Quad Core 22-nm Xeon E5-1620v2 processor (2013 Mac Pro) + // takes 1.312s to start up on macOS Big Sur 2.0GHz quad-core 10th-generation Intel Core i5 processor (2020 13" MacBook Pro) + // round up to 3 seconds to account for slow machines + time.Sleep(3 * time.Second) // takes 0.455s to start up on macOS Big Sur 4-core Xeon +}) + +var _ = AfterSuite(func() { + serverSession.Terminate() + Eventually(serverSession).Should(Exit()) +}) + var _ = Describe("sslip.io-dns-server", func() { //var stdin io.WriteCloser - var err error - var serverCmd *exec.Cmd - var serverSession *Session var digCmd *exec.Cmd var digSession *Session var digArgs string - BeforeSuite(func() { - serverPath, err := Build("main.go") - Expect(err).ToNot(HaveOccurred()) - serverCmd = exec.Command(serverPath) - serverSession, err = Start(serverCmd, GinkgoWriter, GinkgoWriter) - // TODO: bind to unprivileged port (NOT 53) for non-macOS users (e.g. port 35353) - Expect(err).ToNot(HaveOccurred()) - // takes 0.455s to start up on macOS Big Sur 3.7 GHz Quad Core 22-nm Xeon E5-1620v2 processor (2013 Mac Pro) - // takes 1.312s to start up on macOS Big Sur 2.0GHz quad-core 10th-generation Intel Core i5 processor (2020 13" MacBook Pro) - // round up to 3 seconds to account for slow machines - time.Sleep(3 * time.Second) // takes 0.455s to start up on macOS Big Sur 4-core Xeon - }) - - AfterSuite(func() { - serverSession.Terminate() - Eventually(serverSession).Should(Exit()) - }) - Describe("Integration tests", func() { DescribeTable("when the DNS server is queried", func(digArgs string, digResults string, serverLogMessage string) { diff --git a/bosh-release/src/sslip.io-dns-server/xip/xip_suite_test.go b/bosh-release/src/sslip.io-dns-server/xip/xip_suite_test.go index e5d028b..08264ea 100644 --- a/bosh-release/src/sslip.io-dns-server/xip/xip_suite_test.go +++ b/bosh-release/src/sslip.io-dns-server/xip/xip_suite_test.go @@ -3,7 +3,7 @@ package xip_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/bosh-release/src/sslip.io-dns-server/xip/xip_test.go b/bosh-release/src/sslip.io-dns-server/xip/xip_test.go index 732ed2b..fa18f76 100644 --- a/bosh-release/src/sslip.io-dns-server/xip/xip_test.go +++ b/bosh-release/src/sslip.io-dns-server/xip/xip_test.go @@ -10,8 +10,7 @@ import ( clientv3 "go.etcd.io/etcd/client/v3" - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "golang.org/x/net/dns/dnsmessage" )