Skip to content

Commit

Permalink
Merge pull request #685 from rabbitmq/ginkgo-deprecations
Browse files Browse the repository at this point in the history
Remove Ginkgo deprecations
  • Loading branch information
ansd authored May 10, 2021
2 parents dc138cc + eb3c2fa commit 61e9619
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
13 changes: 3 additions & 10 deletions api/v1beta1/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand All @@ -33,14 +32,10 @@ var testEnv *envtest.Environment

func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)

RunSpecsWithDefaultAndCustomReporters(t,
"v1beta1 Suite",
[]Reporter{printer.NewlineReporter{}})
RunSpecs(t, "v1beta1 Suite")
}

var _ = BeforeSuite(func(done Done) {

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

By("bootstrapping test environment")
Expand All @@ -58,9 +53,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
12 changes: 3 additions & 9 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
runtimeClient "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
// +kubebuilder:scaffold:imports
Expand All @@ -55,13 +54,10 @@ var (

func TestControllers(t *testing.T) {
RegisterFailHandler(Fail)

RunSpecsWithDefaultAndCustomReporters(t,
"Controller Suite",
[]Reporter{printer.NewlineReporter{}})
RunSpecs(t, "Controller Suite")
}

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

By("bootstrapping test environment")
Expand Down Expand Up @@ -101,9 +97,7 @@ var _ = BeforeSuite(func(done Done) {

client = mgr.GetClient()
Expect(client).ToNot(BeNil())

close(done)
}, 60)
})

var _ = AfterSuite(func() {
By("tearing down the test environment")
Expand Down

0 comments on commit 61e9619

Please sign in to comment.