Skip to content

Commit 628a292

Browse files
authored
fix: Improve hardcode images test
1 parent 777fc96 commit 628a292

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

integration-tests/robot/tests/zookeeper/image_tests/image_tests.robot

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,27 @@ Library String
66
Library Collections
77
Library PlatformLibrary managed_by_operator=%{ZOOKEEPER_IS_MANAGED_BY_OPERATOR}
88

9+
*** Keywords ***
10+
Get Image Tag
11+
[Arguments] ${image}
12+
${parts}= Split String ${image} :
13+
${length}= Get Length ${parts}
14+
Run Keyword If ${length} > 1 Return From Keyword ${parts[2]} ELSE Fail Image has no tag: ${image}
915

1016
*** Test Cases ***
1117
Test Hardcoded Images
1218
[Tags] zookeeper zookeeper_images
1319
${stripped_resources}= Strip String ${MONITORED_IMAGES} characters=, mode=right
1420
@{list_resources} = Split String ${stripped_resources} ,
1521
FOR ${resource} IN @{list_resources}
16-
${type} ${name} ${container_name} ${image}= Split String ${resource}
22+
${type} ${name} ${container_name} ${image}= Split String ${resource}
1723
${resource_image}= Get Resource Image ${type} ${name} %{OS_PROJECT} ${container_name}
18-
Should Be Equal ${resource_image} ${image}
19-
END
2024

25+
${expected_tag}= Get Image Tag ${image}
26+
${actual_tag}= Get Image Tag ${resource_image}
27+
28+
Log To Console \n[COMPARE] ${resource}: Expected tag = ${expected_tag}, Actual tag = ${actual_tag}
2129

30+
Run Keyword And Continue On Failure Should Be Equal ${actual_tag} ${expected_tag}
31+
32+
END

0 commit comments

Comments
 (0)