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 9, 2024
1 parent 69ea28e commit 9343a4e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/xtf-maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
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 9343a4e

Please sign in to comment.