Skip to content

Commit 3e21e71

Browse files
committed
ING-1419: Add GHA step that runs spectroperf as part of CI
1 parent 4636bdc commit 3e21e71

1 file changed

Lines changed: 114 additions & 0 deletions

File tree

.github/workflows/load_test.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Run Load Tests
2+
permissions:
3+
contents: read
4+
packages: read
5+
6+
on:
7+
push:
8+
tags:
9+
- v*
10+
branches:
11+
- master
12+
pull_request:
13+
14+
jobs:
15+
load-test:
16+
name: Load Test
17+
strategy:
18+
matrix:
19+
server:
20+
- 8.1.0-1262
21+
- 8.0.0
22+
- 7.6.8
23+
- 7.2.8
24+
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
submodules: recursive
30+
- name: Install cbdinocluster
31+
uses: ./.github/actions/install-cbdinocluster
32+
with:
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
- name: Start couchbase cluster
35+
id: start-cluster
36+
uses: ./.github/actions/start-couchbase-cluster
37+
- uses: actions/setup-go@v5
38+
with:
39+
go-version: 1.26
40+
41+
- uses: arduino/setup-protoc@v3
42+
with:
43+
version: 31.1
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
45+
- name: Install Tools
46+
run: |
47+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36
48+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5
49+
go install github.com/matryer/moq@v0.5
50+
- name: Install Dependencies
51+
run: go get ./...
52+
- name: Generate Files
53+
run: go generate ./...
54+
- name: Run Gateway
55+
run: |
56+
go run cmd/gateway/main.go --log-level debug --cb-host "couchbase://${{ steps.start-cluster.outputs.node-ip }}" --self-sign --disable-metrics=true > gateway.log 2>&1 &
57+
sleep 5
58+
59+
- name: Print gateway logs
60+
run: cat gateway.log
61+
62+
- name: Clone and Build spectroperf
63+
run: |
64+
git clone -b configure-artefact-file-name https://github.com/couchbaselabs/spectroperf.git
65+
cd spectroperf
66+
go build -o spectroperf spectroperf.go
67+
mv spectroperf ../sp
68+
69+
- name: Write spectroperf config
70+
run: |
71+
cat > direct_config.toml << EOF
72+
connstr = "couchbase://${{ steps.start-cluster.outputs.node-ip }}"
73+
num-users = [250, 500, 1000, 2000]
74+
ramp-time = "10s"
75+
run-time = "30s"
76+
workload = "user-profile"
77+
sleep = "1s"
78+
tls-skip-verify = true
79+
bucket = "default"
80+
scope = "_default"
81+
collection = "_default"
82+
EOF
83+
84+
- name: Run spectroperf directly
85+
run: |
86+
ls
87+
./sp --config-file="direct_config.toml" --results="direct" --connstr="couchbase://${{ steps.start-cluster.outputs.node-ip }}"
88+
89+
- name: Run spectroperf against gateway
90+
run: |
91+
ls
92+
./sp --config-file="direct_config.toml" --results="gateway" --connstr="couchbase2://localhost:18098"
93+
94+
- name: Print direct metrics
95+
run: |
96+
cat ./direct/metrics.json
97+
98+
- name: Print gateway metrics
99+
run: |
100+
cat ./gateway/metrics.json
101+
102+
- name: Collect couchbase logs
103+
timeout-minutes: 10
104+
if: failure()
105+
run: |
106+
mkdir -p ./logs
107+
cbdinocluster -v collect-logs ${{ steps.start-cluster.outputs.dino-id }} ./logs
108+
- name: Upload couchbase logs
109+
if: failure()
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: cbcollect-logs-${{ matrix.server }}
113+
path: ./logs/*
114+
retention-days: 5

0 commit comments

Comments
 (0)