Skip to content

Commit

Permalink
Update unit test suites
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed Jul 11, 2022
1 parent 08c2ef1 commit 1921935
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
12 changes: 3 additions & 9 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"sigs.k8s.io/cluster-api-provider-azure/internal/test/env"
"sigs.k8s.io/cluster-api-provider-azure/util/reconciler"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
)

// These tests use Ginkgo (BDD-style Go testing framework). Refer to
Expand All @@ -38,13 +37,10 @@ var (

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

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

var _ = BeforeSuite(func(done Done) {
var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = env.NewTestEnvironment()
Expect(NewAzureClusterReconciler(testEnv, testEnv.GetEventRecorderFor("azurecluster-reconciler"), reconciler.DefaultLoopTimeout, "").
Expand All @@ -68,9 +64,7 @@ var _ = BeforeSuite(func(done Done) {
}
return true
}).Should(BeTrue())

close(done)
}, 60)
})

var _ = AfterSuite(func() {
if testEnv != nil {
Expand Down
12 changes: 3 additions & 9 deletions exp/controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"sigs.k8s.io/cluster-api-provider-azure/internal/test/env"
"sigs.k8s.io/cluster-api-provider-azure/util/reconciler"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
"sigs.k8s.io/controller-runtime/pkg/log"
)

Expand All @@ -41,13 +40,10 @@ var (

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

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

var _ = BeforeSuite(func(done Done) {
var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = env.NewTestEnvironment()

Expand Down Expand Up @@ -90,9 +86,7 @@ var _ = BeforeSuite(func(done Done) {
}
return true
}).Should(BeTrue())

close(done)
}, 60)
})

var _ = AfterSuite(func() {
if testEnv != nil {
Expand Down

0 comments on commit 1921935

Please sign in to comment.