Skip to content

Commit 2f870a9

Browse files
docs: fix README.md TestMain example
Signed-off-by: Fabrizio Sestito <[email protected]>
1 parent 27153df commit 2f870a9

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,24 @@ var (
4141
)
4242

4343
func TestMain(m *testing.M) {
44-
testenv = env.New()
45-
kindClusterName := envconf.RandomName("my-cluster", 16)
46-
namespace := envconf.RandomName("myns", 16)
47-
48-
// Use pre-defined environment funcs to create a kind cluster prior to test run
49-
testenv.Setup(
50-
envfuncs.CreateKindCluster(kindClusterName),
51-
)
52-
53-
// Use pre-defined environment funcs to teardown kind cluster after tests
54-
testenv.Finish(
55-
envfuncs.DeleteNamespace(namespace),
56-
)
57-
58-
// launch package tests
59-
os.Exit(testenv.Run(m))
44+
testenv = env.New()
45+
kindClusterName := envconf.RandomName("my-cluster", 16)
46+
namespace := envconf.RandomName("myns", 16)
47+
48+
// Use pre-defined environment funcs to create a kind cluster prior to test run
49+
testenv.Setup(
50+
envfuncs.CreateCluster(kind.NewProvider(), kindClusterName),
51+
envfuncs.CreateNamespace(namespace),
52+
)
53+
54+
// Use pre-defined environment funcs to teardown kind cluster after tests
55+
testenv.Finish(
56+
envfuncs.DeleteNamespace(namespace),
57+
envfuncs.DestroyCluster(kindClusterName),
58+
)
59+
60+
// launch package tests
61+
os.Exit(testenv.Run(m))
6062
}
6163
```
6264

0 commit comments

Comments
 (0)