@@ -31,7 +31,6 @@ import (
31
31
"sigs.k8s.io/cluster-api/test/framework"
32
32
"sigs.k8s.io/controller-runtime/pkg/client"
33
33
"sigs.k8s.io/controller-runtime/pkg/envtest"
34
- "sigs.k8s.io/controller-runtime/pkg/envtest/printer"
35
34
36
35
infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5"
37
36
)
@@ -48,15 +47,16 @@ var (
48
47
func TestAPIs (t * testing.T ) {
49
48
RegisterFailHandler (Fail )
50
49
51
- RunSpecsWithDefaultAndCustomReporters (t ,
52
- "Controller Suite" ,
53
- []Reporter {printer.NewlineReporter {}})
50
+ RunSpecs (t , "Controller Suite" )
54
51
}
55
52
56
- var _ = BeforeSuite (func (done Done ) {
53
+ // See https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md#removed-async-testing
54
+ var _ = BeforeSuite (func () {
57
55
By ("bootstrapping test environment" )
58
56
testEnv = & envtest.Environment {
59
- CRDDirectoryPaths : []string {filepath .Join (".." , "config" , "crd" , "bases" )},
57
+ CRDDirectoryPaths : []string {
58
+ filepath .Join (".." , "config" , "crd" , "bases" ),
59
+ },
60
60
}
61
61
62
62
var err error
@@ -67,17 +67,14 @@ var _ = BeforeSuite(func(done Done) {
67
67
err = infrav1 .AddToScheme (scheme .Scheme )
68
68
Expect (err ).NotTo (HaveOccurred ())
69
69
70
- err = infrav1 .AddToScheme (scheme .Scheme )
71
- Expect (err ).NotTo (HaveOccurred ())
70
+ framework .TryAddDefaultSchemes (scheme .Scheme )
72
71
73
72
// +kubebuilder:scaffold:scheme
74
73
75
74
k8sClient , err = client .New (cfg , client.Options {Scheme : scheme .Scheme })
76
75
Expect (err ).ToNot (HaveOccurred ())
77
76
Expect (k8sClient ).ToNot (BeNil ())
78
-
79
- close (done )
80
- }, 60 )
77
+ })
81
78
82
79
var _ = AfterSuite (func () {
83
80
By ("tearing down the test environment" )
0 commit comments