Skip to content

Commit

Permalink
Add better logging in integration_test Test_NeverProxy
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Hallgren <thomas@tada.se>
  • Loading branch information
thallgren committed Oct 27, 2024
1 parent eab6547 commit 592e60b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion integration_test/kubeconfig_extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,15 @@ func (s *notConnectedSuite) Test_NeverProxy() {
return false
}
m := regexp.MustCompile(`Never Proxy\s*:\s*\((\d+) subnets\)`).FindStringSubmatch(stdout)
return m != nil && m[1] == strconv.Itoa(neverProxiedCount)
if m == nil {
dlog.Infof(ctx, "did not find any never-proxied subnets\nOut: %s", stdout)
return false
}
if m[1] != strconv.Itoa(neverProxiedCount) {
dlog.Infof(ctx, "did not find %d never-proxied subnets\nOut: %s", neverProxiedCount, stdout)
return false
}
return true
}, 5*time.Second, 1*time.Second, fmt.Sprintf("did not find %d never-proxied subnets", neverProxiedCount))

s.Eventually(func() bool {
Expand Down

0 comments on commit 592e60b

Please sign in to comment.