Skip to content

Adds skeleton performance test framework #10

Adds skeleton performance test framework

Adds skeleton performance test framework #10

name: 📋 Performance Test
on:
pull_request:
types: [ synchronize, opened, reopened, ready_for_review ]
concurrency:
group: preview-${{ github.head_ref }}
cancel-in-progress: true
jobs:
performance-test:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Git clone the repository
uses: actions/checkout@v3
- name: Init
run: |
# Set permissions for checkout.
sudo chown -R 1000:1000 $(pwd)
# Create performance testing results directory.
sudo mkdir -p performance-testing/results
sudo chmod 777 performance-testing/results
- name: 📋 Setup
run: |
OTEL_PHP_AUTOLOAD_ENABLED=false docker compose up -d
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
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/basic.js
- name: Enable OTEL
run: |
docker compose stop
docker compose up -d
- name: Rerun K6 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/basic.js
- name: Compare Tests
run: |
cat performance-testing/results/baseline.json | jq .metrics.http_req_duration.avg
cat performance-testing/results/otel.json | jq .metrics.http_req_duration.avg