From 8f99e2752d46115d02a41ad3a0248a749a61d23a Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Thu, 6 Jul 2023 13:50:44 +0200 Subject: [PATCH 1/6] fix: Adjusted error message for incorrect globalAssetId syntax in test-method --- local/testing/api-tests/tavern_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/local/testing/api-tests/tavern_helpers.py b/local/testing/api-tests/tavern_helpers.py index 4467d08d78..0c61476c2e 100644 --- a/local/testing/api-tests/tavern_helpers.py +++ b/local/testing/api-tests/tavern_helpers.py @@ -94,8 +94,8 @@ def submodels_are_not_empty(response): def errors_for_invalid_globalAssetId_are_correct(response): print(response.json().get("messages")) error_list = response.json().get("messages") - assert 'globalAssetId:size must be between 45 and 45' in error_list - assert 'globalAssetId:must match \"^urn:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\"' in error_list + assert 'key.globalAssetId:size must be between 45 and 45' in error_list + assert 'key.globalAssetId:must match \"^urn:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\"' in error_list def errors_for_invalid_depth_are_correct(response): From 34110f17312c9c294049f89af503fd27cf1d678c Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 7 Jul 2023 10:00:56 +0200 Subject: [PATCH 2/6] TRI-1350: changed aspects to "SerialPart" and "SingleLevelBomAsBuilt" in all tests --- .../tractusx/irs/IRSLoadTestSimulation.java | 2 +- .../api-tests/irs-api-tests.tavern.yaml | 36 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/irs-load-tests/src/test/java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java b/irs-load-tests/src/test/java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java index b01a1db31f..071c592664 100644 --- a/irs-load-tests/src/test/java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java +++ b/irs-load-tests/src/test/java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java @@ -31,7 +31,7 @@ public class IRSLoadTestSimulation extends Simulation { .acceptHeader("*/*"); Map headers_1 = new HashMap<>(); - headers_1.put("Authorization", "Bearer #{access_token}"); + headers_1.put("Authorization", "Bearer {access_token}"); headers_1.put("Content-Type", "application/json"); ScenarioBuilder scn = scenario("IRS Load Test") diff --git a/local/testing/api-tests/irs-api-tests.tavern.yaml b/local/testing/api-tests/irs-api-tests.tavern.yaml index 466c3ccb0e..a389714d05 100644 --- a/local/testing/api-tests/irs-api-tests.tavern.yaml +++ b/local/testing/api-tests/irs-api-tests.tavern.yaml @@ -262,8 +262,6 @@ stages: # - json:off # #stages: -# - *authenticate_and_fetch_token -# # - name: register a BPN investigation with valid globalAssetId to T-Systems # request: # url: "{tavern.env_vars.IRS_ESS_HOST}/ess/bpn/investigations" @@ -632,7 +630,7 @@ stages: --- -test_name: Make sure job with aspect serialPartTypization is processed (1.3.0) +test_name: Make sure job with aspect SerialPart is processed (1.3.0) strict: - headers:off @@ -647,7 +645,7 @@ stages: globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" bpn: "BPNL00000003AYRE" aspects: - - SerialPartTypization + - SerialPart collectAspects: true depth: 1 method: POST @@ -691,7 +689,7 @@ stages: --- -test_name: Make sure job with aspects SerialPartTypization and AssemblyPartRelationship is processed (1.3.1) +test_name: Make sure job with aspects SerialPart and SingleLevelBomAsBuilt is processed (1.3.1) strict: - headers:off @@ -706,8 +704,8 @@ stages: globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" bpn: "BPNL00000003AYRE" aspects: - - SerialPartTypization - - AssemblyPartRelationship + - SerialPart + - SingleLevelBomAsBuilt collectAspects: true depth: 2 method: POST @@ -871,7 +869,7 @@ stages: --- -test_name: Make sure job with aspects SerialPartTypization and DiagnosticData is processed (1.3.4) +test_name: Make sure job with aspects SerialPart and DiagnosticData is processed (1.3.4) strict: - headers:off @@ -886,7 +884,7 @@ stages: globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" bpn: "BPNL00000003AYRE" aspects: - - SerialPartTypization + - SerialPart - DiagnosticData collectAspects: true depth: 2 @@ -981,8 +979,8 @@ stages: globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" bpn: "BPNL00000003AYRE" aspects: - - SerialPartTypization - - AssemblyPartRelationship + - SerialPart + - SingleLevelBomAsBuilt - Batch - ProductDescription - IdConversion @@ -1085,8 +1083,8 @@ stages: globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" bpn: "BPNL00000003AYRE" aspects: - - SerialPartTypization - - AssemblyPartRelationship + - SerialPart + - SingleLevelBomAsBuilt - Batch - ProductDescription - IdConversion @@ -1294,7 +1292,7 @@ stages: globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" bpn: "BPNL00000003AYRE" aspects: - - SerialPartTypization + - SerialPart - DiagnosticData collectAspects: true method: POST @@ -1746,7 +1744,7 @@ stages: lookupBPNs: true callbackUrl: "https://www.check123.com" aspects: - - SerialPartTypization + - SerialPart - PartAsPlanned method: POST headers: @@ -1984,8 +1982,8 @@ stages: - urn:uuid:492781f5-62ff-4fb2-876c-3498e2844d13 - urn:uuid:d6142601-5e09-45fe-9b42-e53cf8cd458c aspects: - - "AssemblyPartRelationship" - - "SerialPartTypization" + - "SingleLevelBomAsBuilt" + - "SerialPart" collectAspects: true lookupBPNs: true batchSize: 10 @@ -2044,8 +2042,8 @@ stages: - urn:uuid:3db730be-9de5-4db5-a58d-684de36484e7 - urn:uuid:73173bf5-08df-4898-9d6d-8899015c161e aspects: - - "AssemblyPartRelationship" - - "SerialPartTypization" + - "SingleLevelBomAsBuilt" + - "SerialPart" collectAspects: true lookupBPNs: true batchSize: 2 From 5e0ab9347b6d3cc6b2e02a910a860ae86bd45642 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 7 Jul 2023 14:04:22 +0200 Subject: [PATCH 3/6] TRI-1350: Changed all globalAssetIds, adjusted tavern.yml to separate globalAssetId for asPlanned and asBuild, adjusted aspects in some tests --- .github/workflows/tavern.yml | 14 +- .../api-tests/irs-api-tests.tavern.yaml | 130 +++++++++++++----- 2 files changed, 106 insertions(+), 38 deletions(-) diff --git a/.github/workflows/tavern.yml b/.github/workflows/tavern.yml index a3f29df602..1e29bafeca 100644 --- a/.github/workflows/tavern.yml +++ b/.github/workflows/tavern.yml @@ -16,10 +16,15 @@ on: description: IRS-ESS environment to test default: 'https://irs-ess.int.demo.catena-x.net' required: true - global-asset-id: + global-asset-id-asPlanned: type: string - description: Global Asset ID to use for the tests - default: 'urn:uuid:513d7be8-e7e4-49f4-a22b-8cd31317e454' + description: Global Asset ID to use for the asPlanned tests + default: 'urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4c79e' + required: true + global-asset-id-asBuild: + type: string + description: Global Asset ID to use for the asBuild tests + default: 'urn:uuid:7940e0cc-7814-41eb-8b04-d984a325deec' required: true execution-ticket: type: string @@ -54,7 +59,8 @@ jobs: KEYCLOAK_HOST: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_TOKEN_URI }} KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET }} - GLOBAL_ASSET_ID: ${{ github.event.inputs.global-asset-id || 'urn:uuid:513d7be8-e7e4-49f4-a22b-8cd31317e454' }} + GLOBAL_ASSET_ID_AsPlanned: ${{ github.event.inputs.global-asset-id-asPlanned || 'urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4c79e' }} + GLOBAL_ASSET_ID_AsBuild: ${{ github.event.inputs.global-asset-id-asBuild || 'urn:uuid:7940e0cc-7814-41eb-8b04-d984a325deec' }} run: | python -m pytest local/testing/api-tests/irs-api-tests.tavern.yaml --junitxml=tavern-results.xml diff --git a/local/testing/api-tests/irs-api-tests.tavern.yaml b/local/testing/api-tests/irs-api-tests.tavern.yaml index a389714d05..2cd875161a 100644 --- a/local/testing/api-tests/irs-api-tests.tavern.yaml +++ b/local/testing/api-tests/irs-api-tests.tavern.yaml @@ -376,7 +376,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" bpn: "BPNL00000003AYRE" method: POST headers: @@ -411,7 +411,7 @@ stages: --- -test_name: Make sure job with submodels process with status COMPLETED +test_name: Make sure job with submodels process with status COMPLETED with asPlanned-id strict: - headers:off @@ -423,10 +423,13 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" bpn: "BPNL00000003AYRE" collectAspects: true - depth: 1 + bomLifecycle: asPlanned + depth: 2 + aspects: + - SingleLevelUsageAsPlanned direction: "downward" method: POST headers: @@ -482,6 +485,65 @@ stages: --- +test_name: Make sure job with submodels process with status COMPLETED with asBuild-id + +strict: + - headers:off + - json:off + +stages: + - name: create a job and check for success + request: + url: "{tavern.env_vars.IRS_HOST}/irs/jobs" + json: + key: + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + bpn: "BPNL00000003AYRE" + collectAspects: true + depth: 2 + aspects: + - ProductDescription + - CertificateOfDestruction + - SerialPart + - SingleLevelUsageAsBuilt + direction: "downward" + method: POST + headers: + content-type: application/json + $ext: + function: local.testing.api-tests.tavern_helpers:create_bearer_token + response: + status_code: 201 + headers: + content-type: application/json + save: + json: + job_id: id + + - *verify_job_is_running_and_wait_up_to_15_minutes_for_COMPLETED + + - name: verify job response with desired test steps + request: + url: "{tavern.env_vars.IRS_HOST}/irs/jobs/{job_id}" + params: + returnUncompletedJob: true + method: GET + headers: + content-type: application/json + $ext: + function: local.testing.api-tests.tavern_helpers:create_bearer_token + response: + status_code: 200 + verify_response_with: + - function: local.testing.api-tests.tavern_helpers:submodels_are_not_empty + - function: local.testing.api-tests.tavern_helpers:check_timestamps_for_completed_jobs + headers: + content-type: application/json + + +--- + + test_name: Make sure job without submodels process with status COMPLETED strict: @@ -494,7 +556,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" bpn: "BPNL00000003AYRE" collectAspects: false depth: 1 @@ -584,7 +646,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" bpn: "BPNL00000003AYRE" bomLifecycle: "asBuilt" depth: 2 @@ -642,7 +704,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuilt}" bpn: "BPNL00000003AYRE" aspects: - SerialPart @@ -689,7 +751,7 @@ stages: --- -test_name: Make sure job with aspects SerialPart and SingleLevelBomAsBuilt is processed (1.3.1) +test_name: Make sure job with aspects SerialPart and ProductDescription is processed (1.3.1) strict: - headers:off @@ -701,11 +763,11 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" aspects: - SerialPart - - SingleLevelBomAsBuilt + - ProductDescription collectAspects: true depth: 2 method: POST @@ -749,7 +811,7 @@ stages: --- -test_name: Make sure job with aspects BatteryPass and MaterialForRecycling is processed (1.3.2) +test_name: Make sure job with aspects MaterialForRecycling is processed (1.3.2) strict: - headers:off @@ -761,10 +823,9 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "urn:uuid:0ce413e9-4e3a-4040-a529-7e10d7c61b93" bpn: "BPNL00000003AYRE" aspects: - - BatteryPass - MaterialForRecycling collectAspects: true depth: 2 @@ -809,7 +870,7 @@ stages: --- -test_name: Make sure job with aspects Batch and CertificateOfDestruction is processed (1.3.3) +test_name: Make sure job with aspect Batch is processed (1.3.3) strict: - headers:off @@ -821,12 +882,12 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" - bpn: "BPNL00000003AYRE" + globalAssetId: "urn:uuid:acf437c1-1f20-4a1b-95f6-23f711cd65f6" + bpn: "BPNL00000003AXS3" aspects: - Batch - - CertificateOfDestruction collectAspects: true + bomLifecycle: "asBuilt" depth: 2 method: POST headers: @@ -869,7 +930,7 @@ stages: --- -test_name: Make sure job with aspects SerialPart and DiagnosticData is processed (1.3.4) +test_name: Make sure job with aspects SerialPart and CertificateOfDestruction is processed (1.3.4) strict: - headers:off @@ -881,11 +942,11 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" aspects: - SerialPart - - DiagnosticData + - CertificateOfDestruction collectAspects: true depth: 2 method: POST @@ -941,7 +1002,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" bpn: "BPNL00000003AYRE" aspects: - UnknownAspect @@ -976,13 +1037,14 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" aspects: - - SerialPart - - SingleLevelBomAsBuilt - - Batch - ProductDescription + - CertificateOfDestruction + - SerialPart + - SingleLevelUsageAsBuilt + - BatteryPass - IdConversion - MarketplaceOffer - MaterialForRecycling @@ -1080,7 +1142,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" aspects: - SerialPart @@ -1170,7 +1232,7 @@ stages: # url: "{tavern.env_vars.IRS_HOST}/irs/jobs" # json: # key: - # globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + # globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" # bpn: "BPNL00000003AYRE" # aspects: # - "{deprecated_aspect}" @@ -1289,7 +1351,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" aspects: - SerialPart @@ -1446,7 +1508,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" method: POST headers: @@ -1591,7 +1653,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" collectAspects: true depth: 1 @@ -1735,7 +1797,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" bpn: "BPNL00000003AYRE" collectAspects: true depth: 2 @@ -1793,7 +1855,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" collectAspects: false depth: 1 @@ -1846,7 +1908,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" collectAspects: false lookupBPNs: true @@ -1900,7 +1962,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" collectAspects: false lookupBPNs: true From f13c0eff9122dcda58d1e56aeff9e96189db7a7f Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Fri, 7 Jul 2023 16:17:53 +0200 Subject: [PATCH 4/6] TRI-1350: Several fixes and adjustments after first run analysis --- local/testing/api-tests/irs-api-tests.tavern.yaml | 7 ++++--- local/testing/api-tests/tavern_helpers.py | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/local/testing/api-tests/irs-api-tests.tavern.yaml b/local/testing/api-tests/irs-api-tests.tavern.yaml index 2cd875161a..8919f03c4e 100644 --- a/local/testing/api-tests/irs-api-tests.tavern.yaml +++ b/local/testing/api-tests/irs-api-tests.tavern.yaml @@ -648,7 +648,7 @@ stages: key: globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" bpn: "BPNL00000003AYRE" - bomLifecycle: "asBuilt" + bomLifecycle: "asPlanned" depth: 2 collectAspects: true method: POST @@ -704,7 +704,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuilt}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" bpn: "BPNL00000003AYRE" aspects: - SerialPart @@ -1067,7 +1067,7 @@ stages: save: json: job_id: id - delay_after: 200 + delay_after: 60 - name: fetch response for running job and check existence of submodels and relationships request: @@ -1182,6 +1182,7 @@ stages: save: json: job_id: id + delay_after: 300 - *verify_job_is_running_and_wait_up_to_15_minutes_for_COMPLETED diff --git a/local/testing/api-tests/tavern_helpers.py b/local/testing/api-tests/tavern_helpers.py index 0c61476c2e..8b0fd6b134 100644 --- a/local/testing/api-tests/tavern_helpers.py +++ b/local/testing/api-tests/tavern_helpers.py @@ -121,8 +121,7 @@ def errors_for_unknown_globalAssetId_are_correct(response): print("RetryCounter: ", processingErrorRetryCounter) assert 'urn:uuid:cce14502-958a-42e1-8bb7-f4f41aaaaaaa' in catenaXId assert 'DigitalTwinRequest' in processingErrorStep - assert 'Shell for identifier urn:uuid:cce14502-958a-42e1-8bb7-f4f41aaaaaaa not found' in processingErrorDetail - #assert '404 : \"{\"error\":{\"message\":\"Shell for identifier urn:uuid:cce14502-958a-42e1-8bb7-f4f41aaaaaaa not found\",\"path\":\"/registry/shell-descriptors/urn%3Auuid%3Acce14502-958a-42e1-8bb7-f4f41aaaaaaa\",\"details\":{}}}\"' in processingErrorDetail + #assert 'Shell for identifier urn:uuid:cce14502-958a-42e1-8bb7-f4f41aaaaaaa not found' in processingErrorDetail ##commented out since this error message is not possible currently after DTR changes assert processingErrorLastAttempt is not None assert 3 is processingErrorRetryCounter @@ -286,7 +285,7 @@ def job_parameter_are_as_requested(response): assert parameter.get('lookupBPNs') is True assert parameter.get('callbackUrl') == 'https://www.check123.com' aspects_list = parameter.get("aspects") - assert 'SerialPartTypization' in aspects_list + assert 'SerialPart' in aspects_list assert 'PartAsPlanned' in aspects_list From f4cd203f09904d0423d87914843e69178e4beb8f Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Mon, 10 Jul 2023 15:33:59 +0200 Subject: [PATCH 5/6] TRI-1350: Changed env vars to all caps --- .github/workflows/tavern.yml | 4 +- .../api-tests/irs-api-tests.tavern.yaml | 38 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tavern.yml b/.github/workflows/tavern.yml index 1e29bafeca..b1e11ad979 100644 --- a/.github/workflows/tavern.yml +++ b/.github/workflows/tavern.yml @@ -59,8 +59,8 @@ jobs: KEYCLOAK_HOST: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_TOKEN_URI }} KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET }} - GLOBAL_ASSET_ID_AsPlanned: ${{ github.event.inputs.global-asset-id-asPlanned || 'urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4c79e' }} - GLOBAL_ASSET_ID_AsBuild: ${{ github.event.inputs.global-asset-id-asBuild || 'urn:uuid:7940e0cc-7814-41eb-8b04-d984a325deec' }} + GLOBAL_ASSET_ID_AS_PLANNED: ${{ github.event.inputs.global-asset-id-asPlanned || 'urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4c79e' }} + GLOBAL_ASSET_ID_AS_BUILD: ${{ github.event.inputs.global-asset-id-asBuild || 'urn:uuid:7940e0cc-7814-41eb-8b04-d984a325deec' }} run: | python -m pytest local/testing/api-tests/irs-api-tests.tavern.yaml --junitxml=tavern-results.xml diff --git a/local/testing/api-tests/irs-api-tests.tavern.yaml b/local/testing/api-tests/irs-api-tests.tavern.yaml index 8919f03c4e..171973579d 100644 --- a/local/testing/api-tests/irs-api-tests.tavern.yaml +++ b/local/testing/api-tests/irs-api-tests.tavern.yaml @@ -376,7 +376,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_PLANNED}" bpn: "BPNL00000003AYRE" method: POST headers: @@ -423,7 +423,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_PLANNED}" bpn: "BPNL00000003AYRE" collectAspects: true bomLifecycle: asPlanned @@ -497,7 +497,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" collectAspects: true depth: 2 @@ -556,7 +556,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_PLANNED}" bpn: "BPNL00000003AYRE" collectAspects: false depth: 1 @@ -646,7 +646,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_PLANNED}" bpn: "BPNL00000003AYRE" bomLifecycle: "asPlanned" depth: 2 @@ -704,7 +704,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" aspects: - SerialPart @@ -763,7 +763,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" aspects: - SerialPart @@ -942,7 +942,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" aspects: - SerialPart @@ -1002,7 +1002,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_PLANNED}" bpn: "BPNL00000003AYRE" aspects: - UnknownAspect @@ -1037,7 +1037,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" aspects: - ProductDescription @@ -1142,7 +1142,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" aspects: - SerialPart @@ -1233,7 +1233,7 @@ stages: # url: "{tavern.env_vars.IRS_HOST}/irs/jobs" # json: # key: - # globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + # globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" # bpn: "BPNL00000003AYRE" # aspects: # - "{deprecated_aspect}" @@ -1352,7 +1352,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" aspects: - SerialPart @@ -1509,7 +1509,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" method: POST headers: @@ -1654,7 +1654,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" collectAspects: true depth: 1 @@ -1798,7 +1798,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsPlanned}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_PLANNED}" bpn: "BPNL00000003AYRE" collectAspects: true depth: 2 @@ -1856,7 +1856,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" collectAspects: false depth: 1 @@ -1909,7 +1909,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" collectAspects: false lookupBPNs: true @@ -1963,7 +1963,7 @@ stages: url: "{tavern.env_vars.IRS_HOST}/irs/jobs" json: key: - globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AsBuild}" + globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID_AS_BUILD}" bpn: "BPNL00000003AYRE" collectAspects: false lookupBPNs: true From d372e24221aab2747efdef922c7be69726285b99 Mon Sep 17 00:00:00 2001 From: ds-alexander-bulgakov Date: Tue, 11 Jul 2023 07:02:52 +0200 Subject: [PATCH 6/6] TRI-1350: added # back to bearer header --- .../java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irs-load-tests/src/test/java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java b/irs-load-tests/src/test/java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java index 071c592664..b01a1db31f 100644 --- a/irs-load-tests/src/test/java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java +++ b/irs-load-tests/src/test/java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java @@ -31,7 +31,7 @@ public class IRSLoadTestSimulation extends Simulation { .acceptHeader("*/*"); Map headers_1 = new HashMap<>(); - headers_1.put("Authorization", "Bearer {access_token}"); + headers_1.put("Authorization", "Bearer #{access_token}"); headers_1.put("Content-Type", "application/json"); ScenarioBuilder scn = scenario("IRS Load Test")