From a1561ae3a44044bf2c84466c7c824513ba517f9c Mon Sep 17 00:00:00 2001 From: Dagfinn Olsen Date: Fri, 14 Feb 2025 11:36:18 +0100 Subject: [PATCH 1/5] tweking of thresholds and debug workflow --- .github/workflows/ci-cd-yt01.yml | 3 ++- .../enduser/performance/enduserSearchWithThresholds.js | 4 ++-- .../performance/serviceOwnerSearchWithThresholds.js | 5 ++--- .../serviceowner/performance/serviceowner-search.js | 9 +++------ 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-cd-yt01.yml b/.github/workflows/ci-cd-yt01.yml index 2bd6472e8..e5688272d 100644 --- a/.github/workflows/ci-cd-yt01.yml +++ b/.github/workflows/ci-cd-yt01.yml @@ -125,13 +125,14 @@ jobs: files: - tests/k6/tests/serviceowner/performance/serviceOwnerSearchWithThresholds.js - tests/k6/tests/serviceowner/performance/createDialogWithThresholds.js + - tests/k6/tests/serviceowner/performance/createTransmissionsWithThresholds.js - tests/k6/tests/enduser/performance/enduserSearchWithThresholds.js fail-fast: false with: environment: yt01 apiVersion: v1 vus: 1 - duration: 30s + duration: 60s testSuitePath: ${{ matrix.files }} parallelism: 1 breakpoint: false diff --git a/tests/k6/tests/enduser/performance/enduserSearchWithThresholds.js b/tests/k6/tests/enduser/performance/enduserSearchWithThresholds.js index bf03ab17b..a43989c35 100644 --- a/tests/k6/tests/enduser/performance/enduserSearchWithThresholds.js +++ b/tests/k6/tests/enduser/performance/enduserSearchWithThresholds.js @@ -7,8 +7,8 @@ export let options = { duration: "30s", thresholds: { ..._options.thresholds, - "http_req_duration{name:enduser search}": ["p(95)<300"], - "http_req_duration{name:get dialog}": ["p(95)<300"], + "http_req_duration{name:enduser search}": ["p(95)<500"], + "http_req_duration{name:get dialog}": ["p(95)<500"], "http_req_duration{name:get dialog activities}": ["p(95)<300"], "http_req_duration{name:get dialog activity}": ["p(95)<300"], "http_req_duration{name:get seenlogs}": ["p(95)<300"], diff --git a/tests/k6/tests/serviceowner/performance/serviceOwnerSearchWithThresholds.js b/tests/k6/tests/serviceowner/performance/serviceOwnerSearchWithThresholds.js index bf6f9ce8b..9db6c1186 100644 --- a/tests/k6/tests/serviceowner/performance/serviceOwnerSearchWithThresholds.js +++ b/tests/k6/tests/serviceowner/performance/serviceOwnerSearchWithThresholds.js @@ -1,5 +1,4 @@ import { default as run, options as _options } from "./serviceowner-search.js"; -export { setup as setup } from '../../performancetest_common/readTestdata.js'; export let options = { summaryTrendStats: ['avg', 'min', 'med', 'max', 'p(95)', 'p(99)', 'p(99.5)', 'p(99.9)', 'count'], @@ -7,8 +6,8 @@ export let options = { duration: "30s", thresholds: { ..._options.thresholds, - "http_req_duration{name:serviceowner search}": ["p(95)<300"], - "http_req_duration{name:get dialog}": ["p(95)<300"], + "http_req_duration{name:serviceowner search}": ["p(95)<500"], + "http_req_duration{name:get dialog}": ["p(95)<500"], "http_req_duration{name:get dialog activities}": ["p(95)<300"], "http_req_duration{name:get dialog activity}": ["p(95)<300"], "http_req_duration{name:get seenlogs}": ["p(95)<300"], diff --git a/tests/k6/tests/serviceowner/performance/serviceowner-search.js b/tests/k6/tests/serviceowner/performance/serviceowner-search.js index 4fd78489d..4517d4efd 100644 --- a/tests/k6/tests/serviceowner/performance/serviceowner-search.js +++ b/tests/k6/tests/serviceowner/performance/serviceowner-search.js @@ -1,8 +1,6 @@ import { serviceownerSearch, emptySearchThresholds } from '../../performancetest_common/simpleSearch.js' -import { serviceOwners } from '../../performancetest_common/readTestdata.js'; -import { validateTestData } from '../../performancetest_common/readTestdata.js'; -export { setup as setup } from '../../performancetest_common/readTestdata.js'; - +import { serviceOwners, endUsers } from '../../performancetest_common/readTestdata.js'; +import { randomItem } from '../../../common/k6-utils.js'; const tag_name = 'serviceowner search'; const traceCalls = (__ENV.traceCalls ?? 'false') === 'true'; @@ -17,7 +15,6 @@ export let options = { export default function(data) { - const { endUsers, index } = validateTestData(data, serviceOwners); - serviceownerSearch(serviceOwners[0], endUsers[index], tag_name, traceCalls); + serviceownerSearch(serviceOwners[0], randomItem(endUsers), tag_name, traceCalls); } From e17137bf9d40b27aa628fc861fd70c0a7a819980 Mon Sep 17 00:00:00 2001 From: Dagfinn Olsen Date: Fri, 14 Feb 2025 11:41:09 +0100 Subject: [PATCH 2/5] tweking of thresholds and debug workflow --- .github/workflows/ci-cd-yt01-debug.yml | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/ci-cd-yt01-debug.yml diff --git a/.github/workflows/ci-cd-yt01-debug.yml b/.github/workflows/ci-cd-yt01-debug.yml new file mode 100644 index 000000000..0d761a9e1 --- /dev/null +++ b/.github/workflows/ci-cd-yt01-debug.yml @@ -0,0 +1,40 @@ +# Deploys the created release to yt01 +name: Test K6 performance for CI/CD +run-name: Test K6 performance for CI/CD +on: + push: + branches: + - 'performance/**' + +jobs: + + run-performance-tests: + name: "Run K6 performance tests" + # we want the performance tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests + uses: ./.github/workflows/workflow-run-k6-performance.yml + secrets: + AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} + AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + strategy: + max-parallel: 1 + matrix: + files: + - tests/k6/tests/serviceowner/performance/serviceOwnerSearchWithThresholds.js + - tests/k6/tests/serviceowner/performance/createDialogWithThresholds.js + - tests/k6/tests/serviceowner/performance/createTransmissionsWithThresholds.js + - tests/k6/tests/enduser/performance/enduserSearchWithThresholds.js + fail-fast: false + with: + environment: yt01 + apiVersion: v1 + vus: 1 + duration: 30s + testSuitePath: ${{ matrix.files }} + parallelism: 1 + breakpoint: false + abortOnFail: false + permissions: + checks: write + pull-requests: write + id-token: write + contents: read From 89933685ac1928c46df09274210558c8e55d0521 Mon Sep 17 00:00:00 2001 From: Dagfinn Olsen Date: Fri, 14 Feb 2025 11:51:37 +0100 Subject: [PATCH 3/5] tweking of thresholds and debug workflow --- .github/workflows/ci-cd-yt01-debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-yt01-debug.yml b/.github/workflows/ci-cd-yt01-debug.yml index 0d761a9e1..b78c48bb7 100644 --- a/.github/workflows/ci-cd-yt01-debug.yml +++ b/.github/workflows/ci-cd-yt01-debug.yml @@ -16,7 +16,7 @@ jobs: AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} strategy: - max-parallel: 1 + max-parallel: 4 matrix: files: - tests/k6/tests/serviceowner/performance/serviceOwnerSearchWithThresholds.js From 1a0ddb073a307206ab69072f16699f2b6b04e006 Mon Sep 17 00:00:00 2001 From: Dagfinn Olsen Date: Fri, 14 Feb 2025 12:34:31 +0100 Subject: [PATCH 4/5] set parallelism in performance tests and removed unused workflow --- .github/workflows/ci-cd-yt01.yml | 2 +- .../workflows/workflow-run-k6-ci-cd-yt01.yml | 55 ------------------- 2 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 .github/workflows/workflow-run-k6-ci-cd-yt01.yml diff --git a/.github/workflows/ci-cd-yt01.yml b/.github/workflows/ci-cd-yt01.yml index e5688272d..84f57bb21 100644 --- a/.github/workflows/ci-cd-yt01.yml +++ b/.github/workflows/ci-cd-yt01.yml @@ -120,7 +120,7 @@ jobs: AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} strategy: - max-parallel: 1 + max-parallel: 4 matrix: files: - tests/k6/tests/serviceowner/performance/serviceOwnerSearchWithThresholds.js diff --git a/.github/workflows/workflow-run-k6-ci-cd-yt01.yml b/.github/workflows/workflow-run-k6-ci-cd-yt01.yml deleted file mode 100644 index 722c123f7..000000000 --- a/.github/workflows/workflow-run-k6-ci-cd-yt01.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Run K6 performance tests ci/cd yt01 - -on: - workflow_call: - inputs: - apiVersion: - required: true - type: string - environment: - required: true - type: string - testSuitePath: - required: true - type: string - vus: - required: true - type: number - duration: - required: true - type: string - ref: - description: "The branch or tag ref to run the tests on. Using default checkout ref if not provided." - required: false - default: ${{ github.ref }} - type: string - secrets: - TOKEN_GENERATOR_USERNAME: - required: true - TOKEN_GENERATOR_PASSWORD: - required: true -jobs: - k6-test: - runs-on: ubuntu-latest - environment: ${{ inputs.environment }} - permissions: - checks: write - pull-requests: write - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - - name: Setup k6 - uses: grafana/setup-k6-action@v1 - - name: Run K6 tests (${{ inputs.testSuitePath }}) - run: | - echo "Running k6 test suite ${{ inputs.testSuitePath }} with ${{ inputs.vus }} VUs for ${{ inputs.duration }}" - k6 run ${{ inputs.testSuitePath }} --quiet --log-output=stdout --include-system-env-vars \ - --vus=${{ inputs.vus }} --duration=${{ inputs.duration }} --out csv=./results.csv - grep http_req_duration ./results.csv | sort --field-separator=',' --key=3 -nr | head -10 - env: - API_ENVIRONMENT: ${{ inputs.environment }} - API_VERSION: ${{ inputs.apiVersion }} - TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }} - TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }} \ No newline at end of file From 49c5be6d8cf17a888078dd9254d05b2bd734d330 Mon Sep 17 00:00:00 2001 From: Dagfinn Olsen Date: Fri, 14 Feb 2025 12:40:09 +0100 Subject: [PATCH 5/5] removed debug file --- .github/workflows/ci-cd-yt01-debug.yml | 40 -------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/ci-cd-yt01-debug.yml diff --git a/.github/workflows/ci-cd-yt01-debug.yml b/.github/workflows/ci-cd-yt01-debug.yml deleted file mode 100644 index b78c48bb7..000000000 --- a/.github/workflows/ci-cd-yt01-debug.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Deploys the created release to yt01 -name: Test K6 performance for CI/CD -run-name: Test K6 performance for CI/CD -on: - push: - branches: - - 'performance/**' - -jobs: - - run-performance-tests: - name: "Run K6 performance tests" - # we want the performance tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests - uses: ./.github/workflows/workflow-run-k6-performance.yml - secrets: - AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} - AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} - strategy: - max-parallel: 4 - matrix: - files: - - tests/k6/tests/serviceowner/performance/serviceOwnerSearchWithThresholds.js - - tests/k6/tests/serviceowner/performance/createDialogWithThresholds.js - - tests/k6/tests/serviceowner/performance/createTransmissionsWithThresholds.js - - tests/k6/tests/enduser/performance/enduserSearchWithThresholds.js - fail-fast: false - with: - environment: yt01 - apiVersion: v1 - vus: 1 - duration: 30s - testSuitePath: ${{ matrix.files }} - parallelism: 1 - breakpoint: false - abortOnFail: false - permissions: - checks: write - pull-requests: write - id-token: write - contents: read