Skip to content

Commit

Permalink
chore: parallel run on dcp test
Browse files Browse the repository at this point in the history
  • Loading branch information
erayarslan committed Dec 13, 2023
1 parent 478ff04 commit 0d62dad
Show file tree
Hide file tree
Showing 3 changed files with 230 additions and 16 deletions.
220 changes: 220 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,223 @@ jobs:

- name: Test
run: go test -parallel 1 -v ./...
dcp_test_v501:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 5.0.1
dcp_test_v510:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 5.1.0
dcp_test_v550:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 5.5.0
dcp_test_v600:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 6.0.0
dcp_test_v650:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 6.5.0
dcp_test_v660:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 6.6.0
dcp_test_v700:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 7.0.0
dcp_test_v710:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 7.1.0
dcp_test_v720:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 7.2.0
dcp_test_v723:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 7.2.3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ $ go get github.com/Trendyol/go-dcp
| `dcp.group.membership.config` | map[string]string | no | *not set | Set key-values of config. `expirySeconds`,`heartbeatInterval`,`heartbeatToleranceDuration`,`monitorInterval`,`timeout` for `couchbase` type |
| `dcp.config.disableExpiryOpcode` | bool | no | false | Set this to true if Couchbase Server lower then 6.5.0 |
| `dcp.config.disableStreamEndByClient` | bool | no | false | Set this to true if Couchbase Server lower then 5.5.0 |
| `dcp.config.enableChangeStreams` | bool | no | false | Set this to true if you want to get older versions of changes for Couchbase Server 7.2.0+ using Magma storage buckets |
| `dcp.config.enableChangeStreams` | bool | no | false | Set this to true if you want to get [older versions of changes](https://docs.couchbase.com/server/current/learn/data/change-history.html) for Couchbase Server 7.2.0+ using Magma storage buckets |
| `leaderElection.enabled` | bool | no | false | Set this true for memberships `kubernetesHa`. |
| `leaderElection.type` | string | no | kubernetes | Leader Election types. `kubernetes` |
| `leaderElection.config` | map[string]string | no | *not set | Set key-values of config. `leaseLockName`,`leaseLockNamespace`, `leaseDuration`, `renewDeadline`, `retryPeriod` for `kubernetes` type. |
Expand Down
24 changes: 9 additions & 15 deletions dcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dcp
import (
"context"
"fmt"
"os"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -262,20 +263,13 @@ func test(t *testing.T, version string) {
}

func TestDcp(t *testing.T) {
for _, version := range []string{
"5.0.1",
"5.1.0",
"5.5.0",
"6.0.0",
"6.5.0",
"6.6.0",
"7.0.0",
"7.1.0",
"7.2.0",
"7.2.3",
} {
t.Run(version, func(t *testing.T) {
test(t, version)
})
version := os.Getenv("CB_VERSION")

if version == "" {
t.Skip("Skipping test")
}

t.Run(version, func(t *testing.T) {
test(t, version)
})
}

0 comments on commit 0d62dad

Please sign in to comment.