Skip to content

Commit ac41414

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

2 files changed

Lines changed: 55 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: 32 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,11 @@ 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 = [25, 50, 100, 200, 400, 600, 800]
75+
sleep = "1s"
7676
ramp-time = "10s"
7777
run-time = "30s"
7878
workload = "user-profile"
79-
sleep = "1s"
8079
tls-skip-verify = true
8180
bucket = "default"
8281
scope = "_default"
@@ -127,14 +126,41 @@ jobs:
127126
metrics_p50.png
128127
metrics_p95.png
129128
129+
- name: Push Graphs to Branch
130+
if: github.event_name == 'pull_request'
131+
id: push-graphs
132+
run: |
133+
SERVER="${{ matrix.server }}"
134+
BRANCH="ci-load-test-pr-${{ github.event.pull_request.number }}-${SERVER//./-}"
135+
REPO="${{ github.repository }}"
136+
137+
mkdir -p /tmp/graph-upload
138+
cp metrics_p50.png metrics_p95.png /tmp/graph-upload/
139+
140+
cd /tmp/graph-upload
141+
git init
142+
git config user.email "github-actions[bot]@users.noreply.github.com"
143+
git config user.name "github-actions[bot]"
144+
git add .
145+
git commit -m "Load test graphs for $SERVER"
146+
git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$REPO.git" HEAD:refs/heads/$BRANCH --force
147+
148+
echo "p50-url=https://raw.githubusercontent.com/$REPO/$BRANCH/metrics_p50.png" >> $GITHUB_OUTPUT
149+
echo "p95-url=https://raw.githubusercontent.com/$REPO/$BRANCH/metrics_p95.png" >> $GITHUB_OUTPUT
150+
130151
- name: Post Graphs to PR
131152
uses: thollander/actions-comment-pull-request@v2
132153
if: github.event_name == 'pull_request'
133154
with:
134155
comment_tag: perf-report-${{ matrix.server }}
135156
message: |
136-
### 📊 Performance Metrics Report ${{ matrix.server }}
137-
[View Performance Graphs](${{ steps.upload-graphs.outputs.artifact-url }})
157+
### Performance Metrics Report ${{ matrix.server }}
158+
159+
**P50 Latency:**
160+
![${{ matrix.server }} P50](${{ steps.push-graphs.outputs.p50-url }})
161+
162+
**P95 Latency:**
163+
![${{ matrix.server }} P95](${{ steps.push-graphs.outputs.p95-url }})
138164
139165
- name: Collect couchbase logs
140166
timeout-minutes: 10

0 commit comments

Comments
 (0)