Skip to content

Commit

Permalink
Script it up
Browse files Browse the repository at this point in the history
  • Loading branch information
nickschuch committed Feb 27, 2024
1 parent 331d8b7 commit 0fafb08
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/performance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ jobs:
docker compose exec php-cli composer install --prefer-dist
docker compose exec php-cli ./vendor/drush/drush/drush si demo_umami -y
- name: Get K6 Baseline Test
- name: K6 - Execute Baseline Performance Test
run: |
docker run --rm --network=host -v $(pwd)/performance-testing/results:/results -i docker.io/grafana/k6 run - --summary-export=/results/baseline.json --vus 2 --duration 30s < performance-testing/scenarios/basic.js
bash performance-testing/scripts/k6_run.sh performance-testing/scenarios/basic.js $(pwd)/performance-testing/results baseline.json
- name: Enable OTEL
run: |
docker compose stop
docker compose up -d --wait
- name: Rerun K6 Test
- name: K6 - Execute OpenTelemetry Enabled Performance Test
run: |
docker run --rm --network=host -v $(pwd)/performance-testing/results:/results -i docker.io/grafana/k6 run - --summary-export=/results/otel.json --vus 2 --duration 30s < performance-testing/scenarios/basic.js
bash performance-testing/scripts/k6_run.sh performance-testing/scenarios/otel.js $(pwd)/performance-testing/results baseline.json
- name: Compare Tests
- name: 📋 Review Test Results
run: |
BUDGET=200
bash ./performance-testing/scripts/review_results.sh ./performance-testing/results/baseline.json ./performance-testing/results/otel.json ${BUDGET}
bash performance-testing/scripts/review_results.sh performance-testing/results/baseline.json performance-testing/results/otel.json ${BUDGET}
7 changes: 7 additions & 0 deletions performance-testing/scripts/k6_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

SCENARIO=$1
SUMMARY_EXPORT_DIRECTORY=$2
SUMMARY_EXPORT_FILE_NAME=$3

docker run --rm --network=host -v ${SUMMARY_EXPORT_DIRECTORY}:/results -i docker.io/grafana/k6 run - --summary-export=/results/${SUMMARY_EXPORT_FILE_NAME} --vus 2 --duration 30s < ${SCENARIO}

0 comments on commit 0fafb08

Please sign in to comment.