Skip to content

Commit 5fc67f7

Browse files
committed
logging for test
1 parent a2e7271 commit 5fc67f7

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212

1313
require (
1414
github.com/stretchr/testify v1.9.0
15-
github.com/strowk/foxy-contexts v0.0.4-0.20241208035607-078a2e5414fd
15+
github.com/strowk/foxy-contexts v0.0.4-0.20241208040801-98ae5bd5e918
1616
go.uber.org/mock v0.5.0
1717
k8s.io/api v0.31.3
1818
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ github.com/strowk/foxy-contexts v0.0.4-0.20241208034254-a127d64fc38a h1:uI7o/4BJ
8888
github.com/strowk/foxy-contexts v0.0.4-0.20241208034254-a127d64fc38a/go.mod h1:mqbY/AmvM5uyoITd6+Qtq5gchqwCaIn5pqgbH7v/DeA=
8989
github.com/strowk/foxy-contexts v0.0.4-0.20241208035607-078a2e5414fd h1:fuOaVpR5g7lejUtcEPfSWaLZEo9VPh0JCe3o4588Jxs=
9090
github.com/strowk/foxy-contexts v0.0.4-0.20241208035607-078a2e5414fd/go.mod h1:mqbY/AmvM5uyoITd6+Qtq5gchqwCaIn5pqgbH7v/DeA=
91+
github.com/strowk/foxy-contexts v0.0.4-0.20241208040801-98ae5bd5e918 h1:6zQCEawu+1dpgRusOxeYnKgCniTMB3Z6jimA0xMD2e4=
92+
github.com/strowk/foxy-contexts v0.0.4-0.20241208040801-98ae5bd5e918/go.mod h1:mqbY/AmvM5uyoITd6+Qtq5gchqwCaIn5pqgbH7v/DeA=
9193
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
9294
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
9395
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

main_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import (
1414
)
1515

1616
func TestListContexts(t *testing.T) {
17+
if os.Getenv("CI") != "" {
18+
t.Skip("Skipping k3d tests in CI for now")
19+
}
1720
ts, err := foxytest.Read("testdata/k8s_contexts")
1821
if err != nil {
1922
t.Fatal(err)
@@ -31,6 +34,7 @@ func TestListTools(t *testing.T) {
3134
if err != nil {
3235
t.Fatal(err)
3336
}
37+
ts.WithLogging()
3438
ts.WithExecutable("go", []string{"run", "main.go"})
3539
cntrl := foxytest.NewTestRunner(t)
3640
ts.Run(cntrl)
@@ -43,6 +47,7 @@ func TestInK3dCluster(t *testing.T) {
4347
if os.Getenv("CI") != "" {
4448
t.Skip("Skipping k3d tests in CI for now")
4549
}
50+
4651
ts, err := foxytest.Read("testdata/with_k3d")
4752
if err != nil {
4853
t.Fatal(err)
@@ -67,7 +72,10 @@ func withK3dCluster(t *testing.T, name string, fn func()) {
6772
t.Helper()
6873
cmd := exec.Command("k3d", "cluster", "delete", name)
6974
cmd.Stderr = os.Stderr
70-
cmd.Run() // precleanup if cluster has leaked from previous test
75+
err := cmd.Run() // precleanup if cluster has leaked from previous test
76+
if err != nil {
77+
t.Logf("error in preclean: %v", err)
78+
}
7179

7280
defer deleteK3dCluster(t, name)
7381

0 commit comments

Comments
 (0)