Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix e2e ingress IP helper #11729

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tests/e2e/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,11 @@ func FetchIngressIP(kubeconfig string) ([]string, error) {
if err != nil {
return nil, err
}
ingressIP := strings.Trim(res, " ")
ingressIPs := strings.Split(ingressIP, " ")
return ingressIPs, nil
res = strings.TrimSpace(res)
if res == "" {
return nil, errors.New("no ingress IPs found")
}
return strings.Split(res, " "), nil
}

func (v VagrantNode) FetchNodeExternalIP() (string, error) {
Expand Down
13 changes: 10 additions & 3 deletions tests/e2e/wasm/wasm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ var _ = Describe("Verify K3s can run Wasm workloads", Ordered, func() {
Eventually(func() error {
return tests.AllPodsUp(tc.KubeConfigFile)
}, "620s", "10s").Should(Succeed())
Eventually(func() error {
return tests.CheckDefaultDeployments(tc.KubeConfigFile)
}, "300s", "10s").Should(Succeed())
})

It("Verify wasm-related containerd shims are installed", func() {
Expand Down Expand Up @@ -94,9 +97,13 @@ var _ = Describe("Verify K3s can run Wasm workloads", Ordered, func() {
})

It("Interact with Wasm applications", func() {
ingressIPs, err := e2e.FetchIngressIP(tc.KubeConfigFile)
Expect(err).NotTo(HaveOccurred())
Expect(ingressIPs).To(HaveLen(1))
var ingressIPs []string
var err error
Eventually(func(g Gomega) {
ingressIPs, err = e2e.FetchIngressIP(tc.KubeConfigFile)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(ingressIPs).To(HaveLen(1))
}, "120s", "5s").Should(Succeed())

endpoints := []string{"slight/hello", "spin/go-hello", "spin/hello"}
for _, endpoint := range endpoints {
Expand Down