Skip to content

Commit 9ec696f

Browse files
committed
ING-1088: Run tests that change the cluster in paralell
1 parent bcde66c commit 9ec696f

6 files changed

Lines changed: 267 additions & 17 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Install cbdinocluster
2+
runs:
3+
using: "composite"
4+
steps:
5+
- name: Install cbdinocluster
6+
run: |
7+
mkdir -p "$HOME/bin"
8+
wget -nv -O $HOME/bin/cbdinocluster https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.84/cbdinocluster-linux-amd64
9+
chmod +x $HOME/bin/cbdinocluster
10+
echo "$HOME/bin" >> $GITHUB_PATH
11+
- name: Initialize cbdinocluster
12+
env:
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
run: |
15+
cbdinocluster -v init --auto
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Run 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: Data API Durability Impossible 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+
- uses: actions/checkout@v4
26+
with:
27+
submodules: recursive
28+
- uses: ../actions/install-cbdinocluster
29+
- name: Start couchbase cluster
30+
env:
31+
CLUSTERCONFIG: |
32+
nodes:
33+
- count: 3
34+
version: ${{ matrix.server }}
35+
services: [kv, n1ql, index, fts, cbas]
36+
docker:
37+
kv-memory: 2048
38+
index-memory: 1024
39+
fts-memory: 1024
40+
run: |
41+
CBDC_ID=$(cbdinocluster -v alloc --def="${CLUSTERCONFIG}")
42+
cbdinocluster -v buckets add ${CBDC_ID} default --ram-quota-mb=100 --flush-enabled=true --num-replicas=2
43+
cbdinocluster -v collections add ${CBDC_ID} default _default test
44+
CBDC_IP=$(cbdinocluster -v ip $CBDC_ID)
45+
echo "CBDC_ID=$CBDC_ID" >> "$GITHUB_ENV"
46+
echo "CBDC_IP=$CBDC_IP" >> "$GITHUB_ENV"
47+
48+
- uses: actions/setup-go@v5
49+
with:
50+
go-version: 1.24
51+
- uses: arduino/setup-protoc@v3
52+
with:
53+
version: 31.1
54+
repo-token: ${{ secrets.GITHUB_TOKEN }}
55+
- name: Install Tools
56+
run: |
57+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36
58+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5
59+
go install github.com/matryer/moq@v0.5
60+
- name: Install Dependencies
61+
run: go get ./...
62+
- name: Generate Files
63+
run: |
64+
go generate ./...
65+
- name: Run Test
66+
env:
67+
SGTEST_CBCONNSTR: ${{ env.CBDC_IP }}
68+
SGTEST_DINOID: ${{ env.CBDC_ID }}
69+
run: go test ./gateway/test -run TestGatewayOps -v -testify.m TestDapiDurabilityImpossible
70+
71+
- name: Collect couchbase logs
72+
timeout-minutes: 10
73+
if: failure()
74+
run: |
75+
mkdir -p ./dapi-durability-impossible
76+
cbdinocluster -v collect-logs $CBDC_ID ./dapi-durability-impossible-logs
77+
- name: Upload couchbase logs
78+
if: failure()
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: cbcollect-logs-${{ matrix.server }}
82+
path: ./dapi-durability-impossible/*
83+
retention-days: 5
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Run 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: Durability Impossible 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+
- uses: actions/checkout@v4
26+
with:
27+
submodules: recursive
28+
- uses: ../actions/install-cbdinocluster
29+
- name: Start couchbase cluster
30+
env:
31+
CLUSTERCONFIG: |
32+
nodes:
33+
- count: 3
34+
version: ${{ matrix.server }}
35+
services: [kv, n1ql, index, fts, cbas]
36+
docker:
37+
kv-memory: 2048
38+
index-memory: 1024
39+
fts-memory: 1024
40+
run: |
41+
CBDC_ID=$(cbdinocluster -v alloc --def="${CLUSTERCONFIG}")
42+
cbdinocluster -v buckets add ${CBDC_ID} default --ram-quota-mb=100 --flush-enabled=true --num-replicas=2
43+
cbdinocluster -v collections add ${CBDC_ID} default _default test
44+
CBDC_IP=$(cbdinocluster -v ip $CBDC_ID)
45+
echo "CBDC_ID=$CBDC_ID" >> "$GITHUB_ENV"
46+
echo "CBDC_IP=$CBDC_IP" >> "$GITHUB_ENV"
47+
48+
- uses: actions/setup-go@v5
49+
with:
50+
go-version: 1.24
51+
- uses: arduino/setup-protoc@v3
52+
with:
53+
version: 31.1
54+
repo-token: ${{ secrets.GITHUB_TOKEN }}
55+
- name: Install Tools
56+
run: |
57+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36
58+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5
59+
go install github.com/matryer/moq@v0.5
60+
- name: Install Dependencies
61+
run: go get ./...
62+
- name: Generate Files
63+
run: |
64+
go generate ./...
65+
- name: Run Test
66+
env:
67+
SGTEST_CBCONNSTR: ${{ env.CBDC_IP }}
68+
SGTEST_DINOID: ${{ env.CBDC_ID }}
69+
run: go test ./gateway/test -run TestGatewayOps -v -testify.m TestDurabilityImpossible
70+
71+
- name: Collect couchbase logs
72+
timeout-minutes: 10
73+
if: failure()
74+
run: |
75+
mkdir -p ./durability-impossible-logs
76+
cbdinocluster -v collect-logs $CBDC_ID ./durability-impossible-logs
77+
- name: Upload couchbase logs
78+
if: failure()
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: cbcollect-logs-${{ matrix.server }}
82+
path: ./durability-impossible/*
83+
retention-days: 5
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Run 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: Run SyncWriteAmbiguous Tests
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+
- uses: actions/checkout@v4
26+
with:
27+
submodules: recursive
28+
- uses: ../actions/install-cbdinocluster
29+
- name: Start couchbase cluster
30+
env:
31+
CLUSTERCONFIG: |
32+
nodes:
33+
- count: 3
34+
version: ${{ matrix.server }}
35+
services: [kv, n1ql, index, fts, cbas]
36+
docker:
37+
kv-memory: 2048
38+
index-memory: 1024
39+
fts-memory: 1024
40+
run: |
41+
CBDC_ID=$(cbdinocluster -v alloc --def="${CLUSTERCONFIG}")
42+
cbdinocluster -v buckets add ${CBDC_ID} default --ram-quota-mb=100 --flush-enabled=true --num-replicas=2
43+
cbdinocluster -v collections add ${CBDC_ID} default _default test
44+
CBDC_IP=$(cbdinocluster -v ip $CBDC_ID)
45+
echo "CBDC_ID=$CBDC_ID" >> "$GITHUB_ENV"
46+
echo "CBDC_IP=$CBDC_IP" >> "$GITHUB_ENV"
47+
48+
- uses: actions/setup-go@v5
49+
with:
50+
go-version: 1.24
51+
- uses: arduino/setup-protoc@v3
52+
with:
53+
version: 31.1
54+
repo-token: ${{ secrets.GITHUB_TOKEN }}
55+
- name: Install Tools
56+
run: |
57+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36
58+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5
59+
go install github.com/matryer/moq@v0.5
60+
- name: Install Dependencies
61+
run: go get ./...
62+
- name: Generate Files
63+
run: |
64+
go generate ./...
65+
- name: Run Test
66+
env:
67+
SGTEST_CBCONNSTR: ${{ env.CBDC_IP }}
68+
SGTEST_DINOID: ${{ env.CBDC_ID }}
69+
run: go test ./gateway/test -run TestGatewayOps -v -testify.m TestSyncWriteAmbiguous
70+
71+
- name: Collect couchbase logs
72+
timeout-minutes: 10
73+
if: failure()
74+
run: |
75+
mkdir -p ./sync-write-ambiguous-logs
76+
cbdinocluster -v collect-logs $CBDC_ID ./sync-write-ambiguous-logs
77+
- name: Upload couchbase logs
78+
if: failure()
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: cbcollect-logs-${{ matrix.server }}
82+
path: ./sync-write-ambiguous-logs/*
83+
retention-days: 5

.github/workflows/test.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Install cbdinocluster
2626
run: |
2727
mkdir -p "$HOME/bin"
28-
wget -nv -O $HOME/bin/cbdinocluster https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.84/cbdinocluster-linux-amd64
28+
wget -nv -O $HOME/bin/cbdinocluster https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.86/cbdinocluster-linux-amd64
2929
chmod +x $HOME/bin/cbdinocluster
3030
echo "$HOME/bin" >> $GITHUB_PATH
3131
- name: Initialize cbdinocluster
@@ -74,21 +74,10 @@ 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 }}
90-
SGTEST_DINOID: ${{ env.CBDC_ID }}
91-
run: go test -tags durabilityImpossible ./gateway/test -run TestGatewayOps -v -testify.m TestDurabilityImpossible
80+
run: go test -v $(go list ./... | grep -v /contrib/)
9281

9382
- name: Collect couchbase logs
9483
timeout-minutes: 10

gateway/test/durability_impossible_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build durabilityImpossible
2-
// +build durabilityImpossible
3-
41
package test
52

63
import (

0 commit comments

Comments
 (0)