Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cucumber):[#226] Fix umbrella e2e test scenarios #856

Merged
merged 9 commits into from
Jul 29, 2024
12 changes: 7 additions & 5 deletions .github/workflows/cucumber-integration-test-UMBRELLA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ name: IRS Umbrella Cucumber Integration test execution

on:
workflow_dispatch: # Trigger manually
inputs:
executionFilter:
description: 'Execution filter'
required: false
default: '!Ignore & !INACTIVE & INTEGRATION_TEST & UMBRELLA'
push:
branches:
- 'main'
paths-ignore:
- '**/*.md'
- '**/*.txt'
- 'charts/**'
- '.config/**'
- 'docs/**'
- 'local/**'
- 'irs-load-tests/**'
schedule:
- cron: '0 2 * * 1-5' # At 02:00 on every day-of-week from Monday through Friday.
Comment on lines -35 to -36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no scheduled run anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the Workflow is triggered on every push to main, I don't think it is necessary to run the Umbrella Cucumber Tests scheduled.
The Umbrella Environment is created from scratch every time, so nothing will change between the latest push to main and the scheduled execution


# Cancel previous Test executions if a new one is triggered.
concurrency:
Expand All @@ -42,7 +44,7 @@ concurrency:

jobs:
execute-e2e-tests:
runs-on: ubuntu-latest
runs-on: tractusx-runner
steps:
- uses: actions/checkout@v4

Expand All @@ -56,7 +58,7 @@ jobs:
regularUserApiKey: "password"
adminUserApiKey: "password"
cucumberPublishToken: ${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}
executionFilter: "!Ignore & !INACTIVE & INTEGRATION_TEST & UMBRELLA"
executionFilter: ${{ github.event.inputs.executionFilter || '!Ignore & !INACTIVE & INTEGRATION_TEST & UMBRELLA' }}

- name: Attach logs
if: always() && steps.setup-env.outcome == 'success'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,22 @@ public void iCheckIfTheOrderContainsBatches(int batchesSize) {

@Then("I check, if the batch contains {int} jobs")
public void iCheckIfTheBatchContainsJobs(int jobSize) {
batchResponse = givenAuthentication(authenticationPropertiesBuilder).contentType(ContentType.JSON)
.get("/irs/orders/" + orderId + "/batches/"
+ batchId)
.as(BatchResponse.class);
await().atMost(10, TimeUnit.SECONDS)
.with()
.pollInterval(Duration.ofSeconds(1L))
.until(() -> getBatchResponse().getJobs().size() == jobSize);
batchResponse = getBatchResponse();

assertThat(batchResponse.getJobsInBatchChecksum()).isEqualTo(jobSize);
}

private BatchResponse getBatchResponse() {
return givenAuthentication(authenticationPropertiesBuilder).contentType(ContentType.JSON)
.get("/irs/orders/" + orderId + "/batches/"
+ batchId)
.as(BatchResponse.class);
}

@Then("I check, if job parameter are set with aspects:")
public void iCheckIfJobParameterAreSetWithAspects(List<String> aspects) {
completedJob = givenAuthentication(authenticationPropertiesBuilder).contentType(ContentType.JSON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: IRS support for different aspect models


@UMBRELLA @INTEGRATION_TEST
@TRI-1537 @TRI-1941 @TRI-1942 @TRI-873 @TRI-1843 @TRI-1770 @TRI-1682
@TRI-1537
Scenario: BomLifecycle 'asBuilt' for testing "JustInSequencePart-Model [BPNL00000003AYRE]
Given I register an IRS job for globalAssetId "urn:uuid:57be2fd7-501e-4fea-9f3b-a6c746c3579d" and BPN "BPNL00000003AYRE"
And collectAspects "true"
Expand All @@ -40,7 +40,7 @@ Feature: IRS support for different aspect models
And I check, if "submodels" are equal to "TRI-1537-expected-submodels.json"

@UMBRELLA @INTEGRATION_TEST
@TRI-1598 @TRI-1941 @TRI-1843 @TRI-1942 @TRI-873 @TRI-1770 @TRI-1682
@TRI-1598
Scenario: BomLifecycle 'asBuilt' for testing "Batch"-Model [BPNL00000003AYRE]
Given I register an IRS job for globalAssetId "urn:uuid:54d9154a-01a4-47f1-a798-57d86a5744fa" and BPN "BPNL00000003AYRE"
And collectAspects "true"
Expand All @@ -55,7 +55,7 @@ Feature: IRS support for different aspect models
And I check, if "submodels" are equal to "TRI-1598-expected-submodels.json"

@UMBRELLA @INTEGRATION_TEST
@TRI-1918 @TRI-1941 @TRI-1942 @TRI-1843 @TRI-1682 @TRI-1770 @TRI-873
@TRI-1918
Scenario: End 2 End for aspects "3.0.0#SingleLevelBomAsBuilt"
Given I register an IRS job for globalAssetId "urn:uuid:5cfb33e5-0a95-40e9-8cec-392ee6da7cf1" and BPN "BPNL00000003AYRE"
And aspects :
Expand All @@ -71,7 +71,7 @@ Feature: IRS support for different aspect models
And I check, if "submodels" are equal to "TRI-1918-expected-submodels.json"

@UMBRELLA @INTEGRATION_TEST
@TRI-1915 @TRI-1941 @TRI-1942 @TRI-1843 @TRI-1682 @TRI-1770 @TRI-873
@TRI-1915
Scenario: End 2 End for aspects "3.0.0#SingleLevelBomAsPlanned", "2.0.0#PartAsPlanned"
Given I register an IRS job for globalAssetId "urn:uuid:e5c96ab5-896a-482c-8761-efd74777ca97" and BPN "BPNL00000003AYRE"
And aspects :
Expand All @@ -88,7 +88,7 @@ Feature: IRS support for different aspect models
And I check, if "submodels" are equal to "TRI-1915-expected-submodels.json"

@UMBRELLA @INTEGRATION_TEST
@TRI-1914 @TRI-1941 @TRI-1942 @TRI-1843 @TRI-1770 @TRI-1682 @TRI-873
@TRI-1914
Scenario: End 2 End for aspects "3.0.0#Batch" with "1.0.0#PartSiteInformationAsBuilt"
Given I register an IRS job for globalAssetId "urn:uuid:d78045d5-4ee7-4980-b24c-31dafeb6f54f" and BPN "BPNL00000003AYRE"
And aspects :
Expand All @@ -104,7 +104,7 @@ Feature: IRS support for different aspect models
And I check, if "submodels" are equal to "TRI-1914-expected-submodels.json"

@UMBRELLA @INTEGRATION_TEST
@TRI-1913 @TRI-1941 @TRI-1942 @TRI-1843 @TRI-1682 @TRI-1770 @TRI-873
@TRI-1913
Scenario: End 2 End for aspects "3.0.0#JustInSequencePart", "3.0.0#SerialPart" with "1.0.0#PartSiteInformationAsBuilt"
Given I register an IRS job for globalAssetId "urn:uuid:fc9a079f-1b55-4ccc-8649-e188f899bf39" and BPN "BPNL00000003AYRE"
And aspects :
Expand All @@ -121,7 +121,7 @@ Feature: IRS support for different aspect models
And I check, if "submodels" are equal to "TRI-1913-expected-submodels.json"

@UMBRELLA @INTEGRATION_TEST
@TRI-528 @TRI-1941 @TRI-1942 @TRI-873 @TRI-1843 @TRI-1770 @TRI-1682
@TRI-528
Scenario: End 2 End for aspect "MaterialForRecycling"
Given I register an IRS job for globalAssetId "urn:uuid:4b4d41c3-7a7c-4544-b718-8167a70f517d" and BPN "BPNL00000003AYRE"
And aspects :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: IRS Batch Processing


@UMBRELLA @INTEGRATION_TEST
@TRI-1267 @TRI-1941 @TRI-1942 @TRI-873 @TRI-1843 @TRI-1770
@TRI-1267
Scenario: Check correct job executions of batch processing (SingleLevelBomAsBuilt/SerialPart 3.0.0)
Given I register an IRS batch job for globalAssetIds and BPNs:
| globalAssetId | bpn |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: SingleLevelUsageAsBuilt


@UMBRELLA @INTEGRATION_TEST
@TRI-1009 @TRI-1941 @TRI-1942 @TRI-873 @TRI-1843 @TRI-1770 @TRI-1682
@TRI-1009
Scenario: End 2 End for upward direction and SingleLevelUsageAsBuilt
Given I register an IRS job for globalAssetId "urn:uuid:97eb9ea6-7e66-4ad8-aefe-6ed8aa78ccce" and BPN "BPNL00000003AYRE"
And direction "upward"
Expand All @@ -36,7 +36,7 @@ Feature: SingleLevelUsageAsBuilt
And I check, if "relationships" are equal to "TRI-1009-expected-relationships.json"

@UMBRELLA @INTEGRATION_TEST
@TRI-2035 @TRI-1942 @TRI-1843 @TRI-1682 @TRI-1770 @TRI-1941 @TRI-873
@TRI-2035
Scenario: Tombstone for not found GlobalAssetId
Given I register an IRS job for globalAssetId "urn:uuid:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" and BPN "BPNL00000003AYRE"
And depth 1
Expand All @@ -47,7 +47,7 @@ Feature: SingleLevelUsageAsBuilt
And I check, if "tombstones" are equal to "TRI-2035-expected-tombstones.json"

@UMBRELLA @INTEGRATION_TEST
@TRI-1647 @TRI-1941 @TRI-1942 @TRI-873 @TRI-1843 @TRI-1770 @TRI-1682
@TRI-1647
Scenario: End 2 End for aspect "TractionBatteryCode"
Given I register an IRS job for globalAssetId "urn:uuid:8f5a73b3-766e-47c7-8780-4760a22329af" and BPN "BPNL00000003AYRE"
And collectAspects "true"
Expand All @@ -60,8 +60,9 @@ Feature: SingleLevelUsageAsBuilt
Then I check, if the job has status "COMPLETED" within 20 minutes
And I check, if "submodels" are equal to "TRI-1647-expected-submodels.json"

@Ignore # ignoring this test since the github workflow resources do not allow a test as big as this
@UMBRELLA @INTEGRATION_TEST
@TRI-767 @TRI-1941 @TRI-1942 @TRI-873 @TRI-1843 @TRI-1770 @TRI-1682
@TRI-767
Scenario: End 2 End for OEM-B (MB) [BPN:BPNL00000003AYRE] (SerialPart 3.0.0, SingleLevelBomAsBuilt 3.0.0 , Batch 3.0.0)
Given I register an IRS job for globalAssetId "urn:uuid:4509ea7c-c8d2-41a1-83ca-c214ee34af6c" and BPN "BPNL00000003AYRE"
And collectAspects "true"
Expand All @@ -81,7 +82,7 @@ Feature: SingleLevelUsageAsBuilt
And I check, if submodels contains BPNL number "BPNL00000003AYRE" exactly 248 times

@UMBRELLA @INTEGRATION_TEST
@TRI-704 @TRI-1941 @TRI-1942 @TRI-873 @TRI-1843 @TRI-1770 @TRI-1682
@TRI-704
Scenario: End 2 End for Tier A (ZF) [BPN:BPNL00000003AYRE] (SerialPart 3.0.0, SingleLevelBomAsBuilt 3.0.0 , Batch 3.0.0)
Given I register an IRS job for globalAssetId "urn:uuid:aeada37a-a1d8-4535-a476-5f5e1142e3fe" and BPN "BPNL00000003AYRE"
And aspects :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: BomLifecycle 'asPlanned' implementation


@UMBRELLA @INTEGRATION_TEST
@TRI-893 @TRI-1941 @TRI-1942 @TRI-873 @TRI-1843 @TRI-1770
@TRI-893
Scenario: End 2 End for BomLifecycle 'asPlanned' Vehicle Model C for SAP [BPNL00000003AYRE]
Given I register an IRS job for globalAssetId "urn:uuid:65e1554e-e5cd-4560-bac1-1352582122fb" and BPN "BPNL00000003AYRE"
And collectAspects "true"
Expand All @@ -41,7 +41,7 @@ Feature: BomLifecycle 'asPlanned' implementation
And I check, if "submodels" are equal to "TRI-893-expected-submodels.json"

@UMBRELLA @INTEGRATION_TEST
@TRI-891 @TRI-1941 @TRI-1942 @TRI-873 @TRI-1843 @TRI-1770
@TRI-891
Scenario: End 2 End for BomLifecycle 'asPlanned' Vehicle Model B for MercedesBenz [BPNL00000003AYRE]
Given I register an IRS job for globalAssetId "urn:uuid:68904173-ad59-4a77-8412-3e73fcafbd8b" and BPN "BPNL00000003AYRE"
And collectAspects "true"
Expand All @@ -56,7 +56,7 @@ Feature: BomLifecycle 'asPlanned' implementation
And I check, if "submodels" are equal to "TRI-891-expected-submodels.json"

@UMBRELLA @INTEGRATION_TEST
@TRI-821 @TRI-1941 @TRI-1942 @TRI-873 @TRI-1843 @TRI-1770
@TRI-821
Scenario: End 2 End for BomLifecycle 'asPlanned' Vehicle Model A for BMW [BPNL00000003AYRE]
Given I register an IRS job for globalAssetId "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4c79e" and BPN "BPNL00000003AYRE"
And collectAspects "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-2005 @TRI-1843 @TRI-1941 @TRI-873
@TRI-2005
Scenario: Policy Store API: Delete policy for BPN
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand Down Expand Up @@ -68,7 +68,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-2004 @TRI-1843 @TRI-1941 @TRI-873
@TRI-2004
Scenario: Policy Store API: Trying to register a policy without payload should fail (bad case)
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand All @@ -84,7 +84,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1996 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1996
Scenario: Policy Store API: Try to update policy with invalid policyId (bad case)
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand All @@ -96,7 +96,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1995 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1995
Scenario: Policy Store API: Try to delete policy with invalid policyId (bad case)
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand All @@ -107,7 +107,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1993 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1993
Scenario: Policy Store API: Registering a duplicate policy for same BPNL fails (bad case)
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand All @@ -121,7 +121,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1988 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1988
Scenario: Policy Store API: Try to register policy with invalid policyId (bad case)
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand All @@ -132,7 +132,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1984 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1984
Scenario: Policy Store API: Updating policy for invalid BPNL (bad case)
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand All @@ -156,7 +156,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1981 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1981
Scenario: Policy Store API: Registering policy for invalid BPNL (bad case)
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand All @@ -179,7 +179,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1966 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1966
Scenario: Policy Store API: Fetching policies by BPNLs should fail for invalid BPNLs (bad case)
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand Down Expand Up @@ -214,7 +214,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1965 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1965
Scenario: Policy Store API: Register policy without validUntil (bad case)
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand All @@ -230,7 +230,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1955 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1955
Scenario: Policy Store API: Delete some policies
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand Down Expand Up @@ -288,7 +288,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1954 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1954
Scenario: Policy Store API: Add policyId to given BPNs
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand Down Expand Up @@ -320,7 +320,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1953 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1953
Scenario: Policy Store API: Add BPN to policy
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand All @@ -343,7 +343,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1952 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1952
Scenario: Policy Store API: Update a policy validUntil date for a policy that is associated to multiple BPNs
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand Down Expand Up @@ -394,7 +394,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1951 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1951
Scenario: Policy Store API: Update a policy validUntil date
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand All @@ -411,7 +411,7 @@ Feature: IRS Policy Store

@UMBRELLA @INTEGRATION_TEST
@POLICY_STORE_API
@TRI-1950 @TRI-1843 @TRI-1941 @TRI-873
@TRI-1950
Scenario: Policy Store API: Register policies
# cleanup
Given no policies with prefix "aaaaaaaa-aaaa-aaaa-aaaa-" exist
Expand Down
2 changes: 1 addition & 1 deletion local/testing/testdata/prepare-expected-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

PROVIDER_BPN=$1

bpn_regex_pattern='(BPN)(L|S|A)([a-zA-Z0-9]{12})'
bpn_regex_pattern='(BPNL)([a-zA-Z0-9]{12})'
replacement=$PROVIDER_BPN
directory="irs-cucumber-tests/src/test/resources/expected-files"

Expand Down
4 changes: 2 additions & 2 deletions local/testing/testdata/upload-testdata.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#

# Copyright (c) 2022,2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# Copyright (c) 2021,2024 Contributors to the Eclipse Foundation
#
Expand Down Expand Up @@ -35,7 +35,7 @@ EDC_UPLOAD_URL=$9

EDC_DATAPLANE_URL=${10}

bpn_regex_pattern='(BPN)(L|S|A)([a-zA-Z0-9]{12})'
bpn_regex_pattern='(BPNL)([a-zA-Z0-9]{12})'
replacement=$PROVIDER_BPN

upload_data() {
Expand Down
Loading