Skip to content

Commit 0471362

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

2 files changed

Lines changed: 54 additions & 6 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Cleanup Load Test Branches
2+
permissions:
3+
contents: write
4+
5+
on:
6+
pull_request:
7+
types: [closed]
8+
9+
jobs:
10+
cleanup:
11+
name: Delete Load Test Branches
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Delete branches
15+
run: |
16+
for SERVER in 8.1.0-1262 8.0.0 7.6.8 7.2.8; do
17+
BRANCH="ci-load-test-pr-${{ github.event.pull_request.number }}-${SERVER//./-}"
18+
curl -s -X DELETE \
19+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
20+
-H "Accept: application/vnd.github+json" \
21+
"https://api.github.com/repos/${{ github.repository }}/git/refs/heads/$BRANCH" \
22+
&& echo "Deleted $BRANCH" || echo "Branch $BRANCH not found, skipping"
23+
done

.github/workflows/load_test.yml

Lines changed: 31 additions & 6 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:
@@ -71,12 +71,10 @@ jobs:
7171
run: |
7272
cat > direct_config.toml << EOF
7373
connstr = "couchbase://${{ steps.start-cluster.outputs.node-ip }}"
74-
num-users = [25, 50, 100, 200, 400]
75-
sleep = "100ms"
74+
num-users = [125, 250, 500, 1000, 2000]
7675
ramp-time = "10s"
7776
run-time = "30s"
7877
workload = "user-profile"
79-
sleep = "1s"
8078
tls-skip-verify = true
8179
bucket = "default"
8280
scope = "_default"
@@ -127,14 +125,41 @@ jobs:
127125
metrics_p50.png
128126
metrics_p95.png
129127
128+
- name: Push Graphs to Branch
129+
if: github.event_name == 'pull_request'
130+
id: push-graphs
131+
run: |
132+
SERVER="${{ matrix.server }}"
133+
BRANCH="ci-load-test-pr-${{ github.event.pull_request.number }}-${SERVER//./-}"
134+
REPO="${{ github.repository }}"
135+
136+
mkdir -p /tmp/graph-upload
137+
cp metrics_p50.png metrics_p95.png /tmp/graph-upload/
138+
139+
cd /tmp/graph-upload
140+
git init
141+
git config user.email "github-actions[bot]@users.noreply.github.com"
142+
git config user.name "github-actions[bot]"
143+
git add .
144+
git commit -m "Load test graphs for $SERVER"
145+
git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$REPO.git" HEAD:refs/heads/$BRANCH --force
146+
147+
echo "p50-url=https://raw.githubusercontent.com/$REPO/$BRANCH/metrics_p50.png" >> $GITHUB_OUTPUT
148+
echo "p95-url=https://raw.githubusercontent.com/$REPO/$BRANCH/metrics_p95.png" >> $GITHUB_OUTPUT
149+
130150
- name: Post Graphs to PR
131151
uses: thollander/actions-comment-pull-request@v2
132152
if: github.event_name == 'pull_request'
133153
with:
134154
comment_tag: perf-report-${{ matrix.server }}
135155
message: |
136-
### 📊 Performance Metrics Report ${{ matrix.server }}
137-
[View Performance Graphs](${{ steps.upload-graphs.outputs.artifact-url }})
156+
### Performance Metrics Report ${{ matrix.server }}
157+
158+
**P50 Latency:**
159+
![${{ matrix.server }} P50](${{ steps.push-graphs.outputs.p50-url }})
160+
161+
**P95 Latency:**
162+
![${{ matrix.server }} P95](${{ steps.push-graphs.outputs.p95-url }})
138163
139164
- name: Collect couchbase logs
140165
timeout-minutes: 10

0 commit comments

Comments
 (0)