Adds skeleton performance test framework #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --wait | |
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/scenarios/basic.js | |
- name: Enable OTEL | |
run: | | |
docker compose stop | |
docker compose up -d --wait | |
- 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/scenarios/basic.js | |
- name: Compare Tests | |
run: | | |
BUDGET=200 | |
bash ./performance-testing/scripts/review_results.sh ./performance-testing/results/baseline.json ./performance-testing/results/otel.json ${BUDGET} |