From 4fa77aec6050b0c196c3293ee2ce377e278965af Mon Sep 17 00:00:00 2001 From: Jaro Hartmann Date: Fri, 3 Mar 2023 11:38:39 +0100 Subject: [PATCH 1/9] feat(load-test):[TRI-387] Add gatling load test module --- irs-load-tests/pom.xml | 36 +++++++++++ .../tractusx/irs/IRSLoadTestSimulation.java | 59 +++++++++++++++++++ .../irs/loadtest/IRS-start-job-body.json | 11 ++++ pom.xml | 1 + 4 files changed, 107 insertions(+) create mode 100644 irs-load-tests/pom.xml create mode 100644 irs-load-tests/src/test/java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java create mode 100644 irs-load-tests/src/test/resources/org/eclipse/tractusx/irs/loadtest/IRS-start-job-body.json diff --git a/irs-load-tests/pom.xml b/irs-load-tests/pom.xml new file mode 100644 index 0000000000..e21ae12e05 --- /dev/null +++ b/irs-load-tests/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + + org.eclipse.tractusx.irs + irs-parent-spring-boot + ${revision} + ../irs-parent-spring-boot + + + irs-load-tests + + IRS Load Tests + Item Relationship Service Load Tests + + + + io.gatling.highcharts + gatling-charts-highcharts + 3.9.2 + test + + + + + + + io.gatling + gatling-maven-plugin + 4.3.0 + + + + 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 new file mode 100644 index 0000000000..af5b20ef2d --- /dev/null +++ b/irs-load-tests/src/test/java/org/eclipse/tractusx/irs/IRSLoadTestSimulation.java @@ -0,0 +1,59 @@ +package org.eclipse.tractusx.irs; + +import static io.gatling.javaapi.core.CoreDsl.RawFileBody; +import static io.gatling.javaapi.core.CoreDsl.StringBody; +import static io.gatling.javaapi.core.CoreDsl.atOnceUsers; +import static io.gatling.javaapi.core.CoreDsl.jsonPath; +import static io.gatling.javaapi.core.CoreDsl.scenario; +import static io.gatling.javaapi.http.HttpDsl.http; +import static io.gatling.javaapi.http.HttpDsl.status; + +import java.util.HashMap; +import java.util.Map; + +import io.gatling.javaapi.core.ScenarioBuilder; +import io.gatling.javaapi.core.Simulation; +import io.gatling.javaapi.http.HttpProtocolBuilder; + +public class IRSLoadTestSimulation extends Simulation { + { + final String keycloak_host = System.getenv("KEYCLOAK_HOST"); + final String clientSecret = System.getenv("KEYCLOAK_CLIENT_SECRET"); + final String clientId = System.getenv("KEYCLOAK_CLIENT_ID"); + String body = "grant_type=client_credentials&client_id=" + clientId + "&client_secret=" + clientSecret; + final String irsUrl = System.getenv("IRS_HOST"); + + Map headers_0 = new HashMap<>(); + headers_0.put("Content-Type", "application/x-www-form-urlencoded"); + + HttpProtocolBuilder httpProtocol = http.baseUrl(irsUrl) + .acceptHeader("*/*"); + + Map headers_1 = new HashMap<>(); + headers_1.put("Authorization", "Bearer #{access_token}"); + headers_1.put("Content-Type", "application/json"); + + ScenarioBuilder scn = scenario("IRS Load Test") + .exec(http("Get access token") + .post(keycloak_host) + .body(StringBody(body)) + .asFormUrlEncoded() + .headers(headers_0) + .check(status().is(200)) + .check(jsonPath( + "$.access_token") + .saveAs("access_token"))) + .pause(10) + .exec(http("Start Job") + .post(irsUrl+"/irs/jobs") + .headers(headers_1) + .body(RawFileBody("org/eclipse/tractusx/irs/loadtest/IRS-start-job-body.json")) + .check(jsonPath("$.id") + .saveAs("id"))) + .exec(http("Get Job") + .get("/irs/jobs/#{id}?returnUncompletedJob=true") + .headers(headers_1)); + + setUp(scn.injectOpen(atOnceUsers(10))).protocols(httpProtocol); + } +} diff --git a/irs-load-tests/src/test/resources/org/eclipse/tractusx/irs/loadtest/IRS-start-job-body.json b/irs-load-tests/src/test/resources/org/eclipse/tractusx/irs/loadtest/IRS-start-job-body.json new file mode 100644 index 0000000000..4df7e02f4b --- /dev/null +++ b/irs-load-tests/src/test/resources/org/eclipse/tractusx/irs/loadtest/IRS-start-job-body.json @@ -0,0 +1,11 @@ +{ + "bomLifecycle": "asBuilt", + "aspects": [ + "AssemblyPartRelationship" + ], + "depth": 10, + "direction": "downward", + "collectAspects": true, + "lookupBPNs": true, + "globalAssetId": "urn:uuid:d3c0bf85-d44f-47c5-990d-fec8a36065c6" +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 423d364f35..c1fffb7ec3 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,7 @@ irs-report-aggregate cucumber-tests docs + irs-load-tests From 636f497ed4be7a6cd1873fe65386546973ce25b6 Mon Sep 17 00:00:00 2001 From: Jaro Hartmann Date: Mon, 6 Mar 2023 18:02:54 +0100 Subject: [PATCH 2/9] feat(load-test):[TRI-387] Add JMeter test scenario --- .../jmeter/IRS-Load-Test-Scenario.jmx | 300 ++++++++++++++++++ 1 file changed, 300 insertions(+) create mode 100644 irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx diff --git a/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx b/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx new file mode 100644 index 0000000000..a222449a1e --- /dev/null +++ b/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx @@ -0,0 +1,300 @@ + + + + + + false + true + false + + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + + url + ${__BeanShell( System.getenv("IRS_HOST") )} + = + + + contentType + application/json + = + + + keycloak_url + ${__BeanShell( System.getenv("KEYCLOAK_URL") )} + = + + + client_id + ${__BeanShell( System.getenv("CLIENT_ID") )} + = + + + client_secret + ${__BeanShell( System.getenv("CLIENT_SECRET") )} + = + + + tests-run + ${__BeanShell( System.getenv("TEST_CYCLES") )} + = + + + + + + continue + + false + ${tests-run} + + 1 + 1 + false + + + true + + + + + + + + + false + client_credentials + = + true + grant_type + + + false + ${client_id} + = + true + client_id + + + false + ${client_secret} + = + true + client_secret + + + + + + + + ${keycloak_url} + POST + true + false + true + false + + + + Get access token + + + + + + Content-Type + application/x-www-form-urlencoded + + + + + + access_token + $.access_token + 1 + + + + + + + + + + + + + ${url}/irs/jobs + GET + true + false + true + false + + + + Request All Jobs + + + + + + User-Agent + ApacheJMeter + + + Content-Type + ${contentType} + + + Authorization + Bearer ${access_token} + + + + + + + true + + + + false + { + "bomLifecycle": "asBuilt", + "aspects": [ + "AssemblyPartRelationship" + ], + "depth": 2, + "direction": "downward", + "collectAspects": true, + "lookupBPNs": true, + "globalAssetId": "urn:uuid:fa7ac602-cb4a-4944-ac87-91610bd55f13" +} + = + + + + + + + + ${url}/irs/jobs + POST + true + false + true + false + + + + + + + + + User-Agent + ApacheJMeter + + + Content-Type + ${contentType} + + + Authorization + Bearer ${access_token} + + + + + + job_id + $.id + + + + + + + + + + + + + ${url}/irs/jobs/${job_id} + GET + true + false + true + false + + + + + + + + + User-Agent + ApacheJMeter + + + Content-Type + ${contentType} + + + Authorization + Bearer ${access_token} + + + + + + + + + From 84718f9c3d2a00788b6c60171d499da41f80f9b6 Mon Sep 17 00:00:00 2001 From: Jaro Hartmann Date: Mon, 6 Mar 2023 18:03:30 +0100 Subject: [PATCH 3/9] feat(load-test):[TRI-387] Add GitHub Action for load tests --- .github/workflows/irs-load-test.yaml | 56 +++++++++++++++++++ .../tractusx/irs/IRSLoadTestSimulation.java | 3 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/irs-load-test.yaml diff --git a/.github/workflows/irs-load-test.yaml b/.github/workflows/irs-load-test.yaml new file mode 100644 index 0000000000..66fb6c70ad --- /dev/null +++ b/.github/workflows/irs-load-test.yaml @@ -0,0 +1,56 @@ +name: IRS Load Test + +on: + workflow_dispatch: # Trigger manually + inputs: + irs-host: + type: choice + description: IRS environment to test + default: 'https://irs.int.demo.catena-x.net' + required: true + options: + - 'https://irs.int.demo.catena-x.net' + - 'https://irs.dev.demo.catena-x.net' + test-cycles: + type: number + description: Number of Test Cycles + default: 20 + required: false + +jobs: + jmeter-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Run JMeter tests + env: + IRS_HOST: ${{ github.event.inputs.irs-host || 'https://irs.int.demo.catena-x.net' }} + KEYCLOAK_URL: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_TOKEN_URI }} + CLIENT_ID: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} + CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET }} + TEST_CYCLES: ${{ github.event.inputs.test-cycles || '20' }} + run: | + jmeter -n -t IRS-Load-Test-Scenario.jmx -l log.jtl -e -o logs\ + + - name: Archive Report + # TODO + + gatling-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Run Gatling tests + env: + KEYCLOAK_HOST: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_TOKEN_URI }} + KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} + KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} + IRS_HOST: ${{ github.event.inputs.irs-host || 'https://irs.int.demo.catena-x.net' }} + TEST_CYCLES: ${{ github.event.inputs.test-cycles || '20' }} + run: | + mvn gatling:test -pl irs-load-tests + + - name: Archive Report + # TODO + 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 af5b20ef2d..ab5149b84c 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 @@ -22,6 +22,7 @@ public class IRSLoadTestSimulation extends Simulation { final String clientId = System.getenv("KEYCLOAK_CLIENT_ID"); String body = "grant_type=client_credentials&client_id=" + clientId + "&client_secret=" + clientSecret; final String irsUrl = System.getenv("IRS_HOST"); + final int testCycles = Integer.parseInt(System.getenv("TEST_CYCLES")); Map headers_0 = new HashMap<>(); headers_0.put("Content-Type", "application/x-www-form-urlencoded"); @@ -54,6 +55,6 @@ public class IRSLoadTestSimulation extends Simulation { .get("/irs/jobs/#{id}?returnUncompletedJob=true") .headers(headers_1)); - setUp(scn.injectOpen(atOnceUsers(10))).protocols(httpProtocol); + setUp(scn.injectOpen(atOnceUsers(testCycles))).protocols(httpProtocol); } } From 93bbf55262bb2bd816029c705d20b01cfe6a5091 Mon Sep 17 00:00:00 2001 From: Jaro Hartmann Date: Wed, 8 Mar 2023 09:00:40 +0100 Subject: [PATCH 4/9] feat(load-test):[TRI-387] Adjust Env var names --- .github/workflows/irs-load-test.yaml | 6 +++--- .../src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/irs-load-test.yaml b/.github/workflows/irs-load-test.yaml index 66fb6c70ad..cc177822fa 100644 --- a/.github/workflows/irs-load-test.yaml +++ b/.github/workflows/irs-load-test.yaml @@ -26,9 +26,9 @@ jobs: - name: Run JMeter tests env: IRS_HOST: ${{ github.event.inputs.irs-host || 'https://irs.int.demo.catena-x.net' }} - KEYCLOAK_URL: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_TOKEN_URI }} - CLIENT_ID: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} - CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET }} + KEYCLOAK_HOST: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_TOKEN_URI }} + KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} + KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET }} TEST_CYCLES: ${{ github.event.inputs.test-cycles || '20' }} run: | jmeter -n -t IRS-Load-Test-Scenario.jmx -l log.jtl -e -o logs\ diff --git a/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx b/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx index a222449a1e..7a6cb7444d 100644 --- a/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx +++ b/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx @@ -63,17 +63,17 @@ keycloak_url - ${__BeanShell( System.getenv("KEYCLOAK_URL") )} + ${__BeanShell( System.getenv("KEYCLOAK_HOST") )} = client_id - ${__BeanShell( System.getenv("CLIENT_ID") )} + ${__BeanShell( System.getenv("KEYCLOAK_CLIENT_ID") )} = client_secret - ${__BeanShell( System.getenv("CLIENT_SECRET") )} + ${__BeanShell( System.getenv("KEYCLOAK_CLIENT_SECRET") )} = From 01536bfb95acc5e1e4b13c033b2c723171d54564 Mon Sep 17 00:00:00 2001 From: Jaro Hartmann Date: Wed, 15 Mar 2023 16:15:55 +0100 Subject: [PATCH 5/9] feat(load-test):[TRI-387] Update globalAssetId for load test --- .../src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx b/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx index 7a6cb7444d..f91e3dac8d 100644 --- a/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx +++ b/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx @@ -211,8 +211,7 @@ "depth": 2, "direction": "downward", "collectAspects": true, - "lookupBPNs": true, - "globalAssetId": "urn:uuid:fa7ac602-cb4a-4944-ac87-91610bd55f13" + "globalAssetId": "urn:uuid:d3c0bf85-d44f-47c5-990d-fec8a36065c6" } = From a37cfefaf99ea95b1c4716c9d2445cb813754304 Mon Sep 17 00:00:00 2001 From: Jaro Hartmann Date: Wed, 15 Mar 2023 16:17:18 +0100 Subject: [PATCH 6/9] feat(workflows):[TRI-387] Add step to upload load test report --- .github/workflows/irs-load-test.yaml | 36 +++++++++++++++++++++------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/irs-load-test.yaml b/.github/workflows/irs-load-test.yaml index cc177822fa..f8ec2ed9de 100644 --- a/.github/workflows/irs-load-test.yaml +++ b/.github/workflows/irs-load-test.yaml @@ -3,40 +3,56 @@ name: IRS Load Test on: workflow_dispatch: # Trigger manually inputs: + tool: + type: choice + description: The tool to perform the load test + default: 'JMeter' + required: true + options: + - 'JMeter' + - 'Gatling' irs-host: type: choice description: IRS environment to test - default: 'https://irs.int.demo.catena-x.net' + default: 'https://irs.dev.demo.catena-x.net' required: true options: - - 'https://irs.int.demo.catena-x.net' + - 'https://irs-full.dev.demo.catena-x.net' - 'https://irs.dev.demo.catena-x.net' + - 'https://irs.int.demo.catena-x.net' test-cycles: - type: number + type: string description: Number of Test Cycles - default: 20 + default: '20' required: false jobs: jmeter-test: + if: ${{ github.event.inputs.tool }} == 'JMeter' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Run JMeter tests env: - IRS_HOST: ${{ github.event.inputs.irs-host || 'https://irs.int.demo.catena-x.net' }} + IRS_HOST: ${{ github.event.inputs.irs-host || 'https://irs.dev.demo.catena-x.net' }} KEYCLOAK_HOST: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_TOKEN_URI }} KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET }} TEST_CYCLES: ${{ github.event.inputs.test-cycles || '20' }} + working-directory: irs-load-tests/src/test/resources/jmeter run: | + mkdir logs jmeter -n -t IRS-Load-Test-Scenario.jmx -l log.jtl -e -o logs\ - name: Archive Report - # TODO + uses: actions/upload-artifact@v3 + with: + name: jmeter-report + path: irs-load-tests/src/test/resources/jmeter/logs/ gatling-test: + if: ${{ github.event.inputs.tool }} == 'Gatling' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -46,11 +62,13 @@ jobs: KEYCLOAK_HOST: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_TOKEN_URI }} KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} - IRS_HOST: ${{ github.event.inputs.irs-host || 'https://irs.int.demo.catena-x.net' }} + IRS_HOST: ${{ github.event.inputs.irs-host || 'https://irs.dev.demo.catena-x.net' }} TEST_CYCLES: ${{ github.event.inputs.test-cycles || '20' }} run: | mvn gatling:test -pl irs-load-tests - name: Archive Report - # TODO - + uses: actions/upload-artifact@v3 + with: + name: gatling-report + path: irs-load-tests/target/gatling/ From 30459d26fc9d3a57d658ee2554c3da5d3e776686 Mon Sep 17 00:00:00 2001 From: Jaro Hartmann Date: Wed, 15 Mar 2023 16:39:12 +0100 Subject: [PATCH 7/9] feat(load-test):[TRI-387] Remove unnecessary load test steps --- .../tractusx/irs/IRSLoadTestSimulation.java | 1 - .../jmeter/IRS-Load-Test-Scenario.jmx | 38 ------------------- .../irs/loadtest/IRS-start-job-body.json | 1 - 3 files changed, 40 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 ab5149b84c..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 @@ -44,7 +44,6 @@ public class IRSLoadTestSimulation extends Simulation { .check(jsonPath( "$.access_token") .saveAs("access_token"))) - .pause(10) .exec(http("Start Job") .post(irsUrl+"/irs/jobs") .headers(headers_1) diff --git a/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx b/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx index f91e3dac8d..4c22ee15a1 100644 --- a/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx +++ b/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx @@ -159,44 +159,6 @@ - - - - - - - - - ${url}/irs/jobs - GET - true - false - true - false - - - - Request All Jobs - - - - - - User-Agent - ApacheJMeter - - - Content-Type - ${contentType} - - - Authorization - Bearer ${access_token} - - - - - true diff --git a/irs-load-tests/src/test/resources/org/eclipse/tractusx/irs/loadtest/IRS-start-job-body.json b/irs-load-tests/src/test/resources/org/eclipse/tractusx/irs/loadtest/IRS-start-job-body.json index 4df7e02f4b..ddac6cc053 100644 --- a/irs-load-tests/src/test/resources/org/eclipse/tractusx/irs/loadtest/IRS-start-job-body.json +++ b/irs-load-tests/src/test/resources/org/eclipse/tractusx/irs/loadtest/IRS-start-job-body.json @@ -6,6 +6,5 @@ "depth": 10, "direction": "downward", "collectAspects": true, - "lookupBPNs": true, "globalAssetId": "urn:uuid:d3c0bf85-d44f-47c5-990d-fec8a36065c6" } \ No newline at end of file From ca582a7d1e2ea003be19a9cf5ebc108168ffd1a6 Mon Sep 17 00:00:00 2001 From: Jaro Hartmann Date: Wed, 15 Mar 2023 17:05:59 +0100 Subject: [PATCH 8/9] feat(load-test):[TRI-387] Remove JMeter after decision to use Gatling --- .github/workflows/irs-load-test.yaml | 37 +-- .../jmeter/IRS-Load-Test-Scenario.jmx | 261 ------------------ 2 files changed, 2 insertions(+), 296 deletions(-) delete mode 100644 irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx diff --git a/.github/workflows/irs-load-test.yaml b/.github/workflows/irs-load-test.yaml index f8ec2ed9de..4ce332edbb 100644 --- a/.github/workflows/irs-load-test.yaml +++ b/.github/workflows/irs-load-test.yaml @@ -3,18 +3,10 @@ name: IRS Load Test on: workflow_dispatch: # Trigger manually inputs: - tool: - type: choice - description: The tool to perform the load test - default: 'JMeter' - required: true - options: - - 'JMeter' - - 'Gatling' irs-host: type: choice description: IRS environment to test - default: 'https://irs.dev.demo.catena-x.net' + default: 'https://irs-full.dev.demo.catena-x.net' required: true options: - 'https://irs-full.dev.demo.catena-x.net' @@ -27,32 +19,7 @@ on: required: false jobs: - jmeter-test: - if: ${{ github.event.inputs.tool }} == 'JMeter' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Run JMeter tests - env: - IRS_HOST: ${{ github.event.inputs.irs-host || 'https://irs.dev.demo.catena-x.net' }} - KEYCLOAK_HOST: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_TOKEN_URI }} - KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} - KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET }} - TEST_CYCLES: ${{ github.event.inputs.test-cycles || '20' }} - working-directory: irs-load-tests/src/test/resources/jmeter - run: | - mkdir logs - jmeter -n -t IRS-Load-Test-Scenario.jmx -l log.jtl -e -o logs\ - - - name: Archive Report - uses: actions/upload-artifact@v3 - with: - name: jmeter-report - path: irs-load-tests/src/test/resources/jmeter/logs/ - gatling-test: - if: ${{ github.event.inputs.tool }} == 'Gatling' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -62,7 +29,7 @@ jobs: KEYCLOAK_HOST: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_TOKEN_URI }} KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_ID }} - IRS_HOST: ${{ github.event.inputs.irs-host || 'https://irs.dev.demo.catena-x.net' }} + IRS_HOST: ${{ github.event.inputs.irs-host || 'https://irs-full.dev.demo.catena-x.net' }} TEST_CYCLES: ${{ github.event.inputs.test-cycles || '20' }} run: | mvn gatling:test -pl irs-load-tests diff --git a/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx b/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx deleted file mode 100644 index 4c22ee15a1..0000000000 --- a/irs-load-tests/src/test/resources/jmeter/IRS-Load-Test-Scenario.jmx +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - false - true - false - - - - - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - true - false - false - false - true - 0 - true - true - true - true - true - true - - - - - - - - - url - ${__BeanShell( System.getenv("IRS_HOST") )} - = - - - contentType - application/json - = - - - keycloak_url - ${__BeanShell( System.getenv("KEYCLOAK_HOST") )} - = - - - client_id - ${__BeanShell( System.getenv("KEYCLOAK_CLIENT_ID") )} - = - - - client_secret - ${__BeanShell( System.getenv("KEYCLOAK_CLIENT_SECRET") )} - = - - - tests-run - ${__BeanShell( System.getenv("TEST_CYCLES") )} - = - - - - - - continue - - false - ${tests-run} - - 1 - 1 - false - - - true - - - - - - - - - false - client_credentials - = - true - grant_type - - - false - ${client_id} - = - true - client_id - - - false - ${client_secret} - = - true - client_secret - - - - - - - - ${keycloak_url} - POST - true - false - true - false - - - - Get access token - - - - - - Content-Type - application/x-www-form-urlencoded - - - - - - access_token - $.access_token - 1 - - - - - - true - - - - false - { - "bomLifecycle": "asBuilt", - "aspects": [ - "AssemblyPartRelationship" - ], - "depth": 2, - "direction": "downward", - "collectAspects": true, - "globalAssetId": "urn:uuid:d3c0bf85-d44f-47c5-990d-fec8a36065c6" -} - = - - - - - - - - ${url}/irs/jobs - POST - true - false - true - false - - - - - - - - - User-Agent - ApacheJMeter - - - Content-Type - ${contentType} - - - Authorization - Bearer ${access_token} - - - - - - job_id - $.id - - - - - - - - - - - - - ${url}/irs/jobs/${job_id} - GET - true - false - true - false - - - - - - - - - User-Agent - ApacheJMeter - - - Content-Type - ${contentType} - - - Authorization - Bearer ${access_token} - - - - - - - - - From 293a1fb0ae20b1df284f288f045093e949ff1367 Mon Sep 17 00:00:00 2001 From: Jaro Hartmann Date: Wed, 15 Mar 2023 17:17:16 +0100 Subject: [PATCH 9/9] feat(Dockerfile):[TRI-387] Add missing module --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 1aa7a2e6dc..0f3cf4cce1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ COPY irs-testing irs-testing COPY irs-report-aggregate irs-report-aggregate COPY cucumber-tests cucumber-tests COPY docs docs +COPY irs-load-tests irs-load-tests # the --mount option requires BuildKit. RUN --mount=type=cache,target=/root/.m2 mvn -B clean package -pl :$BUILD_TARGET -am -DskipTests