Skip to content

Commit 1104212

Browse files
committed
ING-1088: Run tests that alter the cluster in parallel
1 parent 7915082 commit 1104212

2 files changed

Lines changed: 100 additions & 12 deletions

File tree

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Run Isolated 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+
jobs:
14+
test:
15+
name: Integration Test
16+
strategy:
17+
matrix:
18+
server:
19+
- 8.0.0-3534
20+
- 7.6.5
21+
- 7.2.2
22+
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Install cbdinocluster
26+
run: |
27+
mkdir -p "$HOME/bin"
28+
wget -nv -O $HOME/bin/cbdinocluster https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.84/cbdinocluster-linux-amd64
29+
chmod +x $HOME/bin/cbdinocluster
30+
echo "$HOME/bin" >> $GITHUB_PATH
31+
- name: Initialize cbdinocluster
32+
run: |
33+
cbdinocluster -v init --auto
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Start couchbase cluster
37+
env:
38+
CLUSTERCONFIG: |
39+
nodes:
40+
- count: 3
41+
version: ${{ matrix.server }}
42+
services: [kv, n1ql, index, fts, cbas]
43+
docker:
44+
kv-memory: 2048
45+
index-memory: 1024
46+
fts-memory: 1024
47+
run: |
48+
CBDC_ID=$(cbdinocluster -v alloc --def="${CLUSTERCONFIG}")
49+
cbdinocluster -v buckets add ${CBDC_ID} default --ram-quota-mb=100 --flush-enabled=true --num-replicas=2
50+
cbdinocluster -v collections add ${CBDC_ID} default _default test
51+
CBDC_IP=$(cbdinocluster -v ip $CBDC_ID)
52+
echo "CBDC_ID=$CBDC_ID" >> "$GITHUB_ENV"
53+
echo "CBDC_IP=$CBDC_IP" >> "$GITHUB_ENV"
54+
55+
- uses: actions/checkout@v4
56+
with:
57+
submodules: recursive
58+
- uses: actions/setup-go@v5
59+
with:
60+
go-version: 1.24
61+
- uses: arduino/setup-protoc@v3
62+
with:
63+
version: 31.1
64+
repo-token: ${{ secrets.GITHUB_TOKEN }}
65+
- name: Install Tools
66+
run: |
67+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36
68+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5
69+
go install github.com/matryer/moq@v0.5
70+
- name: Install Dependencies
71+
run: go get ./...
72+
- name: Generate Files
73+
run: |
74+
go generate ./...
75+
- name: Run SyncWriteAmbiguous Tests
76+
env:
77+
SGTEST_CBCONNSTR: ${{ env.CBDC_IP }}
78+
SGTEST_DINOID: ${{ env.CBDC_ID }}
79+
run: go test -tags syncWriteAmbiguous ./gateway/test -run TestGatewayOps -v -testify.m TestSyncWriteAmbiguous
80+
- name: Run DurabilityImpossible Tests
81+
env:
82+
SGTEST_CBCONNSTR: ${{ env.CBDC_IP }}
83+
SGTEST_DINOID: ${{ env.CBDC_ID }}
84+
run: go test -tags durabilityImpossible ./gateway/test -run TestGatewayOps -v -testify.m TestDurabilityImpossible
85+
86+
- name: Collect couchbase logs
87+
timeout-minutes: 10
88+
if: failure()
89+
run: |
90+
mkdir -p ./isolated-logs
91+
cbdinocluster -v collect-logs $CBDC_ID ./isolated-logs
92+
- name: Upload couchbase logs
93+
if: failure()
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: cbcollect-logs-${{ matrix.server }}
97+
path: ./isolated-logs/*
98+
retention-days: 5

.github/workflows/test.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,11 @@ jobs:
7474
run: |
7575
go generate ./...
7676
- name: Run Tests
77-
timeout-minutes: 15
78-
env:
79-
SGTEST_CBCONNSTR: ${{ env.CBDC_IP }}
80-
SGTEST_DINOID: ${{ env.CBDC_ID }}
81-
run: go test -v -timeout 15m $(go list ./... | grep -v /contrib/)
82-
- name: Run SyncWriteAmbiguous Tests
83-
env:
84-
SGTEST_CBCONNSTR: ${{ env.CBDC_IP }}
85-
SGTEST_DINOID: ${{ env.CBDC_ID }}
86-
run: go test -tags syncWriteAmbiguous ./gateway/test -run TestGatewayOps -v -testify.m TestSyncWriteAmbiguous
87-
- name: Run DurabilityImpossible Tests
77+
timeout-minutes: 10
8878
env:
8979
SGTEST_CBCONNSTR: ${{ env.CBDC_IP }}
9080
SGTEST_DINOID: ${{ env.CBDC_ID }}
91-
run: go test -tags durabilityImpossible ./gateway/test -run TestGatewayOps -v -testify.m TestDurabilityImpossible
81+
run: go test -v $(go list ./... | grep -v /contrib/)
9282

9383
- name: Collect couchbase logs
9484
timeout-minutes: 10

0 commit comments

Comments
 (0)