From 9343a4e05a1eafeebe73b28f95eb69d6bcb793cf 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 --- .github/workflows/xtf-maven-release.yml | 13 +++++++------ .../cz/xtf/junit5/extensions/SkipForCondition.java | 11 ++++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/xtf-maven-release.yml b/.github/workflows/xtf-maven-release.yml index f4aab8bc..982fe15b 100644 --- a/.github/workflows/xtf-maven-release.yml +++ b/.github/workflows/xtf-maven-release.yml @@ -30,13 +30,14 @@ jobs: uses: whelk-io/maven-settings-xml-action@v12 with: servers: '[{ "id": "jboss-releases-repository", "username": "${env.JBOSS_REPO_USER}", "password": "${env.JBOSS_REPO_PASSWORD}" },{ "id": "jboss-snapshots-repository", "username": "${env.JBOSS_REPO_USER}", "password": "${env.JBOSS_REPO_PASSWORD}" }]' - - name: Import GPG Key - uses: crazy-max/ghaction-import-gpg@v1 - env: - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} +# - name: Import GPG Key +# uses: crazy-max/ghaction-import-gpg@v1 +# env: +# GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} +# PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - name: Maven Deploy - run: mvn -X deploy -DskipTests -Prelease +# run: mvn -X deploy -DskipTests -Prelease + run: mvn -X deploy -DskipTests env: JBOSS_REPO_PASSWORD: ${{ secrets.JBOSS_REPO_PASSWORD }} JBOSS_REPO_USER: ${{ secrets.JBOSS_REPO_USER }} 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("")) {