Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
strowk committed Dec 8, 2024
1 parent 7186f17 commit c144d7e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ func withK3dCluster(t *testing.T, name string, fn func()) {
cmd.Run() // precleanup if cluster has leaked from previous test

defer deleteK3dCluster(t, name)

t.Log("creating k3d cluster", name)
createK3dCluster(t, name)
saveKubeconfig(t, name)
t.Log("waiting till k3d cluster is ready")
waitForClusterReady(t)
fn()
}
Expand Down Expand Up @@ -166,13 +169,15 @@ waiting:

func deleteK3dCluster(t *testing.T, name string) {
t.Helper()
t.Log("deleting k3d cluster", name)
cmd := exec.Command("k3d", "cluster", "delete", name)
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
t.Error(err)
}

t.Log("removing kubeconfig file")
// remove kubeconfig file
err = os.Remove(kubeconfigPath)
if err != nil {
Expand Down

0 comments on commit c144d7e

Please sign in to comment.