forked from eclipse-tractusx/item-relationship-service
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (101 loc) · 4.42 KB
/
tavern.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Tavern IRS API test on DEV
on:
workflow_dispatch: # Trigger manually
inputs:
irs-host:
type: string
description: IRS environment to test.
default: 'https://irs.dev.demo.catena-x.net'
required: true
irs-ess-host:
type: string
description: IRS-ESS environment to test.
default: 'https://irs-ess.int.demo.catena-x.net'
required: true
global-asset-id-asPlanned:
type: string
description: Global-asset-id to use for the asPlanned tests.
default: 'urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4c79e'
required: true
bpn-asPlanned:
type: string
description: BPN to use for the asPlanned global-asset-id.
default: 'BPNL00000003AYRE'
required: true
global-asset-id-asBuilt:
type: string
description: Global-asset-id to use for the asBuilt tests.
default: 'urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c'
required: true
bpn-asBuilt:
type: string
description: BPN to use for the asBuilt global-asset-id.
default: 'BPNL00000003AVTH'
required: true
global-asset-id-ess-asBuilt:
type: string
description: Global-asset-id to use for the asBuilt tests.
default: 'urn:uuid:2c57b0e9-a653-411d-bdcd-64787e9fd3a7'
required: true
bpn-ess-asBuilt:
type: string
description: BPN to use for the asBuilt global-asset-id.
default: 'BPNL00000003CRHK'
required: true
bpn-ess-incident:
type: string
description: Incident BPN to search for which violates against environmental and social standards.
default: 'BPNS00000003B6LU'
required: true
execution-ticket:
type: string
description: JIRA execution ticket to safe results in.
default: 'TRI-910'
required: true
schedule:
- cron: '0 1 * * 1-5' # At 01:00 on every day-of-week from Monday through Friday.
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.10.7
- name: Install dependencies
run: |
pip install pytest
pip install py
pip install tavern
pip list
- name: Run tests
env:
IRS_HOST: ${{ 'https://irs.dev.demo.catena-x.net' }}
IRS_ESS_HOST: ${{ github.event.inputs.irs-ess-host || 'https://irs-ess.int.demo.catena-x.net' }}
REGULAR_USER_API_KEY: ${{ secrets.DEV_REGULAR_USER_API_KEY }}
ADMIN_USER_API_KEY: ${{ secrets.DEV_ADMIN_USER_API_KEY }}
REGULAR_USER_API_KEY_ESS: ${{ secrets.INT_REGULAR_USER_API_KEY }}
ADMIN_USER_API_KEY_ESS: ${{ secrets.INT_ADMIN_USER_API_KEY }}
GLOBAL_ASSET_ID_AS_PLANNED: ${{ github.event.inputs.global-asset-id-asPlanned || 'urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4c79e' }}
GLOBAL_ASSET_ID_ESS_AS_BUILT: ${{ github.event.inputs.global-asset-id-ess-asBuilt || 'urn:uuid:2c57b0e9-a653-411d-bdcd-64787e9fd3a7' }}
BPN_ESS_AS_BUILT: ${{ github.event.inputs.bpn-ess-asBuilt || 'BPNL00000003CRHK' }}
BPN_ESS_INCIDENT: ${{ github.event.inputs.bpn-ess-incident || 'BPNS00000003B6LU' }}
BPN_AS_PLANNED: ${{ github.event.inputs.bpn-asPlanned || 'BPNL00000003AYRE' }}
GLOBAL_ASSET_ID_AS_BUILT: ${{ github.event.inputs.global-asset-id-asBuilt || 'urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c' }}
BPN_AS_BUILT: ${{ github.event.inputs.bpn-asBuilt || 'BPNL00000003AVTH' }}
run: |
python -m pytest local/testing/api-tests/irs-api-tests.tavern.yaml --junitxml=tavern-results.xml
- name: Upload results
if: always()
env:
JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }}
JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }}
TEST_EXECUTION_TICKET: ${{ github.event.inputs.execution-ticket || 'TRI-910' }}
# Remove tokens and upload the tavern results to JIRA Test execution
run: |
sed "s/access_tok.*:s = '.*'//g" tavern-results.xml | sed "s/Authorization: Bearer .*/Authorization:/g" | uniq > result.xml
curl -H "Content-Type: multipart/form-data" \
-u $JIRA_USERNAME:$JIRA_PASSWORD \
-F '[email protected]' \
"https://jira.catena-x.net/rest/raven/1.0/import/execution/junit?testExecKey=$TEST_EXECUTION_TICKET"