forked from eclipse-tractusx/item-relationship-service
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 2.19 KB
/
BETA-xray-cucumber-integration.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: IRS BETA Cucumber Integration test Xray execution
on:
workflow_dispatch: # Trigger manually
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Cache maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Download Feature Files
id: download
env:
JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }}
JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }}
# JIRA filter 11590: project = "TRI" AND type = Test AND "Test Type" = Cucumber AND environment ~ Beta
# Downloads all feature files of cucumber tests inside TRI project
run: |
export HTTP_RESULT=$(curl -s --show-error -w "%{http_code}" -u $JIRA_USERNAME:$JIRA_PASSWORD "https://jira.catena-x.net/rest/raven/1.0/export/test?filter=11590&fz=true" -o features.zip)
[[ $HTTP_RESULT == 200 || $HTTP_RESULT == 400 ]]
echo "::set-output name=http_response::$HTTP_RESULT"
- name: Build with Maven
if: ${{ steps.download.outputs.http_response == '200' }}
env:
REGULAR_USER_API_KEY: ${{ secrets.BETA_REGULAR_USER_API_KEY }}
ADMIN_USER_API_KEY: ${{ secrets.BETA_ADMIN_USER_API_KEY }}
run: |
unzip -o features.zip -d irs-cucumber-tests/src/test/resources/features
mvn --batch-mode clean install -pl irs-cucumber-tests,irs-models -D"cucumber.filter.tags"="not @Ignore and @INTEGRATION_TEST"
- name: Submit results to Xray
if: ${{ always() && steps.download.outputs.http_response == '200' }}
env:
JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }}
JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }}
run: |
curl --request POST -u $JIRA_USERNAME:$JIRA_PASSWORD --header 'Content-Type: application/json' --data-binary '@irs-cucumber-tests/report.json' "https://jira.catena-x.net/rest/raven/1.0/import/execution/cucumber"