From 4f44408079a2577b80720342b9f9359dc21c795f Mon Sep 17 00:00:00 2001 From: Artem Badeinov <51969741+Gravelord@users.noreply.github.com> Date: Tue, 23 Sep 2025 03:04:42 +0300 Subject: [PATCH 1/3] fix: Improve hardcode images test --- tests/robot/image_tests/image_tests.robot | 50 +++++++++++++++-------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/tests/robot/image_tests/image_tests.robot b/tests/robot/image_tests/image_tests.robot index 74d03332..d1eab131 100644 --- a/tests/robot/image_tests/image_tests.robot +++ b/tests/robot/image_tests/image_tests.robot @@ -1,28 +1,42 @@ *** Settings *** -Library String -Library Collections -Resource ../Lib/lib.robot +Library String +Library Collections +Resource ../Lib/lib.robot + +*** Variables *** +${PG_NAMESPACE} %{OPENSHIFT_WORKSPACE_WA} *** Keywords *** +Get Image Tag + [Arguments] ${image} + ${parts}= Split String ${image} : + ${length}= Get Length ${parts} + Run Keyword If ${length} > 1 Return From Keyword ${parts[2]} ELSE Fail Image has no tag: ${image} + Compare Images From Resources With Dd - [Arguments] ${dd_images} - ${stripped_resources}= Strip String ${dd_images} characters=, mode=right - @{list_resources} = Split String ${stripped_resources} , - FOR ${resource} IN @{list_resources} - ${type} ${name} ${container_name} ${image}= Split String ${resource} - ${resource_image}= Get Image From Resource ${type} ${name} ${container_name} - Should Be Equal ${resource_image} ${image} + [Arguments] ${dd_images} + ${stripped_resources}= Strip String ${dd_images} characters=, mode=right + @{list_resources}= Split String ${stripped_resources} , + FOR ${resource} IN @{list_resources} + ${type} ${name} ${container_name} ${image}= Split String ${resource} + ${resource_image}= Get Image From Resource ${type} ${name} ${container_name} + + ${expected_tag}= Get Image Tag ${image} + ${actual_tag}= Get Image Tag ${resource_image} + + Log To Console \n[COMPARE] ${resource}: Expected tag = ${expected_tag}, Actual tag = ${actual_tag} + Run Keyword And Continue On Failure Should Be Equal ${actual_tag} ${expected_tag} END *** Test Cases *** Test Hardcoded Images For Core Services - [Tags] patroni basic check_pg_images - ${dd_images}= Get Dd Images From Config Map patroni-tests-config - Skip If '${dd_images}' == '${None}' There is no dd, not possible to check case! - Compare Images From Resources With Dd ${dd_images} + [Tags] patroni basic check_pg_images + ${dd_images}= Get Dd Images From Config Map patroni-tests-config + Skip If '${dd_images}' == '${None}' There is no dd, not possible to check case! + Compare Images From Resources With Dd ${dd_images} Test Hardcoded Images For Supplementary Services - [Tags] backup basic check_pg_images - ${dd_images}= Get Dd Images From Config Map supplementary-tests-config - Skip If '${dd_images}' == '${None}' There is no dd, not possible to check case! - Compare Images From Resources With Dd ${dd_images} + [Tags] backup basic check_pg_images + ${dd_images}= Get Dd Images From Config Map supplementary-tests-config + Skip If '${dd_images}' == '${None}' There is no dd, not possible to check case! + Compare Images From Resources With Dd ${dd_images} From 5ec91954b0f7d3fa81298ea28706cc6222013d35 Mon Sep 17 00:00:00 2001 From: Artem Badeinov <51969741+Gravelord@users.noreply.github.com> Date: Tue, 21 Oct 2025 14:39:18 +0300 Subject: [PATCH 2/3] fix: Improve hardcode images test --- tests/robot/image_tests/image_tests.robot | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/robot/image_tests/image_tests.robot b/tests/robot/image_tests/image_tests.robot index d1eab131..6ecef044 100644 --- a/tests/robot/image_tests/image_tests.robot +++ b/tests/robot/image_tests/image_tests.robot @@ -11,7 +11,10 @@ Get Image Tag [Arguments] ${image} ${parts}= Split String ${image} : ${length}= Get Length ${parts} - Run Keyword If ${length} > 1 Return From Keyword ${parts[2]} ELSE Fail Image has no tag: ${image} + Run Keyword If ${length} > 1 Return From Keyword ${parts[2]} + Run Keywords + ... Log To Console \n[ERROR] Image ${parts} has no tag: ${image}\nMonitored images list: ${MONITORED_IMAGES} + ... AND Fail Some images were not found, please check your .helpers template and description.yaml in the repository Compare Images From Resources With Dd [Arguments] ${dd_images} From 54a68084d8a3fde4b74f83c550ab7898f5ac1347 Mon Sep 17 00:00:00 2001 From: Artem Badeinov <51969741+Gravelord@users.noreply.github.com> Date: Tue, 21 Oct 2025 14:56:07 +0300 Subject: [PATCH 3/3] fix: Improve hardcode images test --- tests/robot/image_tests/image_tests.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/robot/image_tests/image_tests.robot b/tests/robot/image_tests/image_tests.robot index 6ecef044..5279af2a 100644 --- a/tests/robot/image_tests/image_tests.robot +++ b/tests/robot/image_tests/image_tests.robot @@ -13,7 +13,7 @@ Get Image Tag ${length}= Get Length ${parts} Run Keyword If ${length} > 1 Return From Keyword ${parts[2]} Run Keywords - ... Log To Console \n[ERROR] Image ${parts} has no tag: ${image}\nMonitored images list: ${MONITORED_IMAGES} + ... Log To Console \n[ERROR] Image ${parts} has no tag: ${image}\nMonitored images list: ${dd_images} ... AND Fail Some images were not found, please check your .helpers template and description.yaml in the repository Compare Images From Resources With Dd