Skip to content

Commit 9fb3382

Browse files
committed
Adds Github comment
1 parent 4b0beb9 commit 9fb3382

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

.github/workflows/performance-test.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
K6_RESULTS_DIR: ./performance-testing/results
1515

1616
jobs:
17-
performance-test:
17+
run:
1818
runs-on: ubuntu-latest
1919

2020
steps:
@@ -34,13 +34,13 @@ jobs:
3434
run: |
3535
OTEL_PHP_AUTOLOAD_ENABLED=false docker compose up -d --wait
3636
docker compose exec php-cli composer install --prefer-dist
37-
docker compose exec php-cli ./vendor/drush/drush/drush si demo_umami -y
37+
docker compose exec php-cli drush si demo_umami -y
3838
3939
- name: 🧪 K6 - Execute Baseline Performance Test
4040
run: |
4141
bash ${K6_SCRIPTS_DIR}/k6_run.sh ${K6_SCENARIO} ${K6_RESULTS_DIR} baseline.json
4242
43-
- name: ⚙️ Enable OTEL
43+
- name: ⚙️ Enable OpenTelemetry Auto Instrumentation
4444
run: |
4545
docker compose stop
4646
docker compose up -d --wait
@@ -52,4 +52,21 @@ jobs:
5252
- name: 📋 Review Test Results
5353
run: |
5454
BUDGET=200
55-
bash ${K6_SCRIPTS_DIR}/review_results.sh ${K6_RESULTS_DIR}/baseline.json ${K6_RESULTS_DIR}/otel.json ${BUDGET}
55+
bash ${K6_SCRIPTS_DIR}/review_results.sh ${K6_RESULTS_DIR}/baseline.json ${K6_RESULTS_DIR}/otel.json ${BUDGET} ${K6_RESULTS_DIR}/comment.txt
56+
57+
- name: 📦 Collect Test Result Comment Details
58+
id: comment
59+
if: always()
60+
run: |
61+
results=$(cat ${K6_RESULTS_DIR}/comment.txt)
62+
echo "results=$results" >> "$GITHUB_OUTPUT"
63+
64+
- name: 📋 Post Test Results to Comment
65+
uses: peter-evans/create-or-update-comment@v4
66+
if: always()
67+
with:
68+
issue-number: ${{ github.event.pull_request.number }}
69+
body: |
70+
Performance Data
71+
----------------
72+
${{ steps.comment.outputs.results }}

performance-testing/scripts/review_results.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ if [[ "${BASH_SOURCE[0]}" = "$0" ]]; then
1919
BASELINE_FILE=$1
2020
OTEL_FILE=$2
2121
BUDGET=$3
22-
23-
info "Starting performance review..."
22+
PRETTY_REPORT=$4
2423

2524
fails_baseline=$(cat ${BASELINE_FILE} | jq -r .root_group.checks.ok.fails)
2625
fails_otel=$(cat ${OTEL_FILE} | jq -r .root_group.checks.ok.fails)
@@ -53,6 +52,8 @@ if [[ "${BASH_SOURCE[0]}" = "$0" ]]; then
5352

5453
http_req_duration_diff=`expr $http_req_duration_otel - $http_req_duration_baseline`
5554

55+
echo "Before = ${http_req_duration_baseline}\nAfter = ${http_req_duration_otel}\nDifference = ${http_req_duration_diff}" > $PRETTY_REPORT
56+
5657
info "http_req_duration diff = ${http_req_duration_diff}"
5758

5859
if (( $http_req_duration_diff > $BUDGET )); then

0 commit comments

Comments
 (0)