Skip to content

Commit c7886a2

Browse files
committed
ING-1399: Embedd results graphs directly into PR
1 parent beb9820 commit c7886a2

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

.github/workflows/load_test.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run Load Tests
22
permissions:
33
pull-requests: write
4-
contents: read
4+
contents: write
55
packages: read
66

77
on:
@@ -127,14 +127,41 @@ jobs:
127127
metrics_p50.png
128128
metrics_p95.png
129129
130+
- name: Push Graphs to Branch
131+
if: github.event_name == 'pull_request'
132+
id: push-graphs
133+
run: |
134+
SERVER="${{ matrix.server }}"
135+
BRANCH="ci-load-test-pr-${{ github.event.pull_request.number }}-${SERVER//./-}"
136+
REPO="${{ github.repository }}"
137+
138+
mkdir -p /tmp/graph-upload
139+
cp metrics_p50.png metrics_p95.png /tmp/graph-upload/
140+
141+
cd /tmp/graph-upload
142+
git init
143+
git config user.email "github-actions[bot]@users.noreply.github.com"
144+
git config user.name "github-actions[bot]"
145+
git add .
146+
git commit -m "Load test graphs for $SERVER"
147+
git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$REPO.git" HEAD:refs/heads/$BRANCH --force
148+
149+
echo "p50-url=https://raw.githubusercontent.com/$REPO/$BRANCH/metrics_p50.png" >> $GITHUB_OUTPUT
150+
echo "p95-url=https://raw.githubusercontent.com/$REPO/$BRANCH/metrics_p95.png" >> $GITHUB_OUTPUT
151+
130152
- name: Post Graphs to PR
131153
uses: thollander/actions-comment-pull-request@v2
132154
if: github.event_name == 'pull_request'
133155
with:
134156
comment_tag: perf-report-${{ matrix.server }}
135157
message: |
136-
### 📊 Performance Metrics Report ${{ matrix.server }}
137-
[View Performance Graphs](${{ steps.upload-graphs.outputs.artifact-url }})
158+
### Performance Metrics Report ${{ matrix.server }}
159+
160+
**P50 Latency:**
161+
![${{ matrix.server }} P50](${{ steps.push-graphs.outputs.p50-url }})
162+
163+
**P95 Latency:**
164+
![${{ matrix.server }} P95](${{ steps.push-graphs.outputs.p95-url }})
138165
139166
- name: Collect couchbase logs
140167
timeout-minutes: 10

0 commit comments

Comments
 (0)