From 81174c36de57ce68a4ff976caf825f24369971e8 Mon Sep 17 00:00:00 2001 From: mchoma Date: Wed, 9 Oct 2024 11:44:13 +0200 Subject: [PATCH] [#591] continue in test if skip condition cant be evaluated --- .../cz/xtf/junit5/extensions/SkipForCondition.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/junit5/src/main/java/cz/xtf/junit5/extensions/SkipForCondition.java b/junit5/src/main/java/cz/xtf/junit5/extensions/SkipForCondition.java index a1787211..ab36f3ec 100644 --- a/junit5/src/main/java/cz/xtf/junit5/extensions/SkipForCondition.java +++ b/junit5/src/main/java/cz/xtf/junit5/extensions/SkipForCondition.java @@ -13,6 +13,7 @@ import cz.xtf.core.config.OpenShiftConfig; import cz.xtf.core.config.XTFConfig; import cz.xtf.core.image.Image; +import cz.xtf.core.image.UnknownImageException; import cz.xtf.core.openshift.OpenShifts; import cz.xtf.junit5.annotations.SkipFor; import cz.xtf.junit5.annotations.SkipFors; @@ -46,7 +47,15 @@ public static ConditionEvaluationResult resolve(SkipFor skipFor) { "Only one of 'name', 'imageMetadataLabelName', 'imageMetadataLabelArchitecture' and 'subId' can be presented in 'SkipFor' annotation."); } - Image image = Image.resolve(skipFor.image()); + Image image = null; + try { + image = Image.resolve(skipFor.image()); + } catch (UnknownImageException uie) { + return ConditionEvaluationResult.enabled( + "Cannot get image for '" + skipFor.image() + + "' therefore cannot evaluate skip condition properly. Continue in test."); + } + Matcher matcher; if (!skipFor.name().equals("")) {