From d31ac1a753ccdf3eebabad20d21f3a7ffdac7253 Mon Sep 17 00:00:00 2001 From: Tunahan Cicek Date: Fri, 3 Nov 2023 15:41:32 +0100 Subject: [PATCH] Fix failed e2e Tests. --- .github/workflows/aas-registry-e2e-test.yml | 18 ++++++++- e2e-tests/aas-registry/common.yaml | 5 ++- e2e-tests/aas-registry/test_api.tavern.yaml | 42 ++++++++++----------- 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/.github/workflows/aas-registry-e2e-test.yml b/.github/workflows/aas-registry-e2e-test.yml index 33b3d163..89ebaee8 100644 --- a/.github/workflows/aas-registry-e2e-test.yml +++ b/.github/workflows/aas-registry-e2e-test.yml @@ -34,6 +34,9 @@ on: aasRegistryUrl: description: 'AAS-Registry-Url' required: true + edcBpn: + description: 'EDC-BPN' + required: true jobs: end_to_end_tests: @@ -41,12 +44,22 @@ jobs: 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 @@ -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 diff --git a/e2e-tests/aas-registry/common.yaml b/e2e-tests/aas-registry/common.yaml index fd9747cf..17811d0b 100644 --- a/e2e-tests/aas-registry/common.yaml +++ b/e2e-tests/aas-registry/common.yaml @@ -22,4 +22,7 @@ description: Contains common variable definitions. variables: - aas_registry_api_url: "{tavern.env_vars.AAS_REGISTRY_API_URL}" \ No newline at end of file + 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" \ No newline at end of file diff --git a/e2e-tests/aas-registry/test_api.tavern.yaml b/e2e-tests/aas-registry/test_api.tavern.yaml index fec80873..7e5117df 100644 --- a/e2e-tests/aas-registry/test_api.tavern.yaml +++ b/e2e-tests/aas-registry/test_api.tavern.yaml @@ -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: @@ -65,7 +65,7 @@ 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) @@ -73,7 +73,7 @@ stages: 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}" @@ -81,18 +81,18 @@ stages: 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: @@ -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: @@ -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 \ No newline at end of file