Skip to content

Commit

Permalink
chore(workflows):[#828] fix cucumber test execution order
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-jhartmann committed Jul 26, 2024
1 parent d450322 commit a117872
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions .github/workflows/cucumber-integration-test-xray.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
JIRA_USERNAME: ${{ secrets.jiraUser }}
JIRA_PASSWORD: ${{ secrets.jiraPassword }}
EXPORT_FILTER: ${{ inputs.exportFilter }}
# Downloads all feature files of cucumber tests inside TRI project
# Downloads all IRS feature files of cucumber tests
run: |
token=$(curl -H "Content-Type: application/json" -X POST \
--data "{ \"client_id\": \"$JIRA_USERNAME\",\"client_secret\": \"$JIRA_PASSWORD\" }" \
Expand All @@ -60,16 +60,20 @@ jobs:
[[ $HTTP_RESULT == 200 || $HTTP_RESULT == 400 ]]
echo "::set-output name=http_response::$HTTP_RESULT"
- name: Build with Maven
- name: Run Tests with Maven
if: ${{ steps.download.outputs.http_response == '200' }}
env:
KEYCLOAK_HOST: ${{ secrets.keycloakTokenUrl }}
KEYCLOAK_CLIENT_ID: ${{ secrets.clientId }}
KEYCLOAK_CLIENT_SECRET: ${{ secrets.clientSecret }}
REGULAR_USER_API_KEY: ${{ secrets.regularUserApiKey }}
ADMIN_USER_API_KEY: ${{ secrets.adminUserApiKey }}
ISSUE_FILTER: ${{ inputs.executionFilter }}
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.cucumberPublishToken }}
run: |
unzip -o features.zip -d irs-cucumber-tests/src/test/resources/org/eclipse/tractusx/irs/cucumber/features
mvn --batch-mode clean install -pl irs-cucumber-tests,irs-models -D"cucumber.filter.tags"="$ISSUE_FILTER"
# workaround replacement since injecting the token via environment variable does not work
sed -i "s/CUCUMBER_TOKEN_IRS_PLACEHOLDER/${CUCUMBER_PUBLISH_TOKEN}/g" irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java
mvn clean verify -P cucumber -Dgroups="$ISSUE_FILTER" -pl irs-cucumber-tests -am --batch-mode 2> irs-cucumber-tests/report-banner.txt
- name: Submit results to Xray
if: ${{ always() && steps.download.outputs.http_response == '200' }}
Expand All @@ -87,18 +91,6 @@ jobs:
--data-binary '@irs-cucumber-tests/target/report.json' \
"https://xray.cloud.getxray.app/api/v2/import/execution/cucumber"
- name: Run Tests with Maven
env:
REGULAR_USER_API_KEY: ${{ secrets.regularUserApiKey }}
ADMIN_USER_API_KEY: ${{ secrets.adminUserApiKey }}
ISSUE_FILTER: ${{ inputs.executionFilter }}
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.cucumberPublishToken }}
run: |
# workaround replacement since injecting the token via environment variable does not work
sed -i "s/CUCUMBER_TOKEN_IRS_PLACEHOLDER/${CUCUMBER_PUBLISH_TOKEN}/g" irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java
mvn clean verify -P cucumber -Dgroups="$ISSUE_FILTER" -pl irs-cucumber-tests -am --batch-mode 2> irs-cucumber-tests/report-banner.txt
- name: Publish Cucumber Results
uses: EnricoMi/[email protected]

Check notice

Code scanning / KICS

Unpinned Actions Full Length Commit SHA Note

Action is not pinned to a full length commit SHA.
if: always()
Expand Down

0 comments on commit a117872

Please sign in to comment.