Skip to content

Commit

Permalink
Merge pull request #241 from bci-oss/bugfix/fix-e2etests
Browse files Browse the repository at this point in the history
Fix failed e2e Tests.
  • Loading branch information
tunacicek authored Nov 3, 2023
2 parents 5291d03 + d31ac1a commit 9774aff
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 24 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/aas-registry-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,32 @@ on:
aasRegistryUrl:
description: 'AAS-Registry-Url'
required: true
edcBpn:
description: 'EDC-BPN'
required: true

jobs:
end_to_end_tests:
runs-on: ubuntu-latest
name: Execute End-to-End tests

steps:
- name: Mask Input Credentials
run: |
mask_client_secret=$(jq -r '.inputs.clientSecret' $GITHUB_EVENT_PATH)
echo ::add-mask::$mask_client_secret
echo mask_client_secret=$mask_client_secret >> $GITHUB_ENV
mask_edc_bpn=$(jq -r '.inputs.edcBpn' $GITHUB_EVENT_PATH)
echo ::add-mask::$mask_edc_bpn
echo mask_edc_bpn=$mask_edc_bpn >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.8"
check-latest: true

- name: Install python dependencies
Expand All @@ -60,9 +73,10 @@ jobs:
py.test . -vv --html=./output/report.html --self-contained-html
env:
CLIENT_ID: ${{ inputs.clientId }}
CLIENT_SECRET: ${{ inputs.clientSecret }}
CLIENT_SECRET: ${{ env.mask_client_secret }}
AUTH_SERVER_TOKEN_URL: ${{ inputs.tokenUrl }}
AAS_REGISTRY_API_URL: ${{ inputs.aasRegistryUrl }}
EDC_BPN: ${{ env.mask_edc_bpn }}

- name: Upload test report
uses: actions/upload-artifact@v3
Expand Down
5 changes: 4 additions & 1 deletion e2e-tests/aas-registry/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ description:
Contains common variable definitions.

variables:
aas_registry_api_url: "{tavern.env_vars.AAS_REGISTRY_API_URL}"
aas_registry_api_url: "{tavern.env_vars.AAS_REGISTRY_API_URL}"
edc_bpn: "{tavern.env_vars.EDC_BPN}"
decoded_shell_id: 20062250-6b6e-4eba-bf90-7720ddc855e9
encoded_shell_id: "MjAwNjIyNTAtNmI2ZS00ZWJhLWJmOTAtNzcyMGRkYzg1NWU5"
42 changes: 21 additions & 21 deletions e2e-tests/aas-registry/test_api.tavern.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ stages:
headers:
Content-Type: application/json
Authorization: "Bearer {access_token}"
Edc-Bpn: "default-tenant"
Edc-Bpn: "{edc_bpn:s}"
response:
status_code: 200
headers:
Expand All @@ -65,34 +65,34 @@ stages:
headers:
Content-Type: application/json
Authorization: "Bearer {access_token}"
Edc-Bpn: "default-tenant"
Edc-Bpn: "{edc_bpn:s}"
json:
id: "{decoded_shell_id:s}"
idShort: twin of a break (Testing)
response:
status_code: 201
headers:
content-type: application/json

- name: Get shell descriptor by id
request:
url: "{aas_registry_api_url:s}/api/v3.0/shell-descriptors/{encoded_shell_id:s}"
method: GET
headers:
Content-Type: application/json
Authorization: "Bearer {access_token}"
Edc-Bpn: "default-tenant"
response:
status_code: 200
headers:
content-type: application/json
json:
description: [ ]
displayName: [ ]
idShort: twin of a break (Testing)
id: "{decoded_shell_id:s}"
specificAssetIds: []
submodelDescriptors: []
Edc-Bpn: "{edc_bpn:s}"
response:
status_code: 200
headers:
content-type: application/json
json:
description: []
displayName: []
idShort: twin of a break (Testing)
id: "{decoded_shell_id:s}"
specificAssetIds: []
submodelDescriptors: []

- name: Update shell descriptor by id
request:
Expand All @@ -101,12 +101,12 @@ stages:
headers:
Content-Type: application/json
Authorization: "Bearer {access_token}"
Edc-Bpn: "default-tenant"
Edc-Bpn: "{edc_bpn:s}"
json:
id: "{decoded_shell_id:s}"
idShort: twin of a break (Testing Update)
response:
status_code: 204
response:
status_code: 204

- name: Delete shell descriptor by id
request:
Expand All @@ -115,6 +115,6 @@ stages:
headers:
Content-Type: application/json
Authorization: "Bearer {access_token}"
Edc-Bpn: "default-tenant"
response:
status_code: 204
Edc-Bpn: "{edc_bpn:s}"
response:
status_code: 204

0 comments on commit 9774aff

Please sign in to comment.