Skip to content

Commit ba3ccdf

Browse files
committed
chore(tests): fixes after CR
1 parent 82ea5bf commit ba3ccdf

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

e2e-next/constants/image.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,19 @@ func GetTag() string {
3838
}
3939

4040
func SetImage(image string) {
41-
parts := strings.SplitN(image, ":", 2)
42-
repository = parts[0]
43-
44-
if len(parts) == 2 {
45-
tag = parts[1]
41+
if strings.Contains(image, "@") {
42+
// Handle digest format: repo@sha256:xxx
43+
parts := strings.SplitN(image, "@", 2)
44+
repository = parts[0]
45+
tag = "@" + parts[1]
4646
} else {
47-
tag = ""
47+
// Handle tag format: repo:tag
48+
parts := strings.SplitN(image, ":", 2)
49+
repository = parts[0]
50+
if len(parts) == 2 {
51+
tag = parts[1]
52+
} else {
53+
tag = ""
54+
}
4855
}
4956
}

e2e-next/test_core/sync/test_node.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var _ = Describe("Node sync",
5050
It("Sync nodes using label selector", func(ctx context.Context) {
5151

5252
hostname := constants.GetClusterName() + "-control-plane"
53-
if kindName, ok := os.LookupEnv("KIND_NAME"); ok {
53+
if kindName, ok := os.LookupEnv("KIND_NAME"); ok && kindName != "" {
5454
hostname = kindName + "-control-plane"
5555
}
5656
Eventually(func(g Gomega) {
@@ -70,7 +70,8 @@ var _ = Describe("Node sync",
7070
}
7171

7272
g.Expect(hostSyncedNodeName).ToNot(BeEmpty(), "Should find host node with matching hostname")
73-
g.Expect(hostSyncedNodeName).To(Equal(virtualNodes.Items[0].Name), "Synced node name should match")
73+
g.Expect(virtualNodes.Items).To(HaveLen(1), "Expected exactly one synced node")
74+
g.Expect(virtualNodes.Items[0].Name).To(Equal(hostSyncedNodeName), "Synced node name should match")
7475
}).
7576
WithPolling(constants.PollingInterval).
7677
WithTimeout(constants.PollingTimeout).

e2e-next/test_deploy/test_helm_charts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ var _ = Describe("Helm charts (regular and OCI) are synced and applied as expect
8181
}
8282
}).
8383
WithPolling(constants.PollingInterval).
84-
WithTimeout(constants.PollingTimeoutShort).
84+
WithTimeout(constants.PollingTimeout).
8585
Should(Succeed(), "Both charts should be successfully deployed")
8686
})
8787

0 commit comments

Comments
 (0)