Skip to content

Commit

Permalink
[xtf-cz#591] continue in test if skip condition cant be evaluated
Browse files Browse the repository at this point in the history
  • Loading branch information
mchoma committed Oct 10, 2024
1 parent 69ea28e commit 81174c3
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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("")) {
Expand Down

0 comments on commit 81174c3

Please sign in to comment.