Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop-in replacement for gocql #296

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/gocqlx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: GocqlX integration tests
on:
pull_request:
permissions:
contents: read
jobs:
integration:
name: GocqlX integration tests
runs-on: ubuntu-latest
env:
SCYLLA_VERSION: 5.0.0
GOBIN: ./bin
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
repository: scylladb/gocqlx

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.18.0
stable: true

- name: Replace gocql with scylla-go-driver
run: |
go mod edit -go=1.18
go mod edit -replace github.com/gocql/gocql=github.com/scylladb/scylla-go-driver/gocql@${{github.event.pull_request.head.sha}}
go mod tidy

- name: Make Directory for GOBIN
run: mkdir -p ${GOBIN}

- name: Download Dependencies
run: make get-deps

- name: Run scylla
run: make run-scylla

- name: Run GocqlX tests
run: |
go test -cpu 1 -count=1 -cover -race -tags all .
go test -cpu 1 -count=1 -cover -race -tags all ./qb
go test -cpu 1 -count=1 -cover -race -tags all ./table
go test -cpu 1 -count=1 -cover -race -tags all ./migrate
go test -cpu 1 -count=1 -cover -race -tags all ./dbutil

- name: Stop cluster
run: make stop-scylla
68 changes: 68 additions & 0 deletions .github/workflows/scylla-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Scylla Manager integration tests
on:
pull_request:
permissions:
contents: read
jobs:
integration:
name: Scylla Manager integration tests
runs-on: ubuntu-latest
steps:
- name: Check out driver
uses: actions/checkout@v2

- name: Save commit SHA in env
run: echo "DRIVER_VERSION=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
repository: scylladb/scylla-manager

- name: Set Go version
run: |
echo "GOVERSION=$(cat .go-version)" >> $GITHUB_ENV

- name: Set up Go
uses: actions/setup-go@v1
id: go
with:
go-version: "${{env.GOVERSION}}"

- name: Set up env variables
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
echo "$(go env -w GOCACHE=/home/runner/work/scylla-manager/scylla-manager/.cache/go-build/)"
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "GOCACHEPATTERN=.cache/go-build/**" >> $GITHUB_ENV
echo "date=$(date +'%m-%Y')" >> $GITHUB_ENV

- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
./install-dependencies.sh

- name: Replace gocql with scylla-go-driver
run: |
go mod edit -go=1.18
go mod edit -replace github.com/gocql/gocql=github.com/scylladb/scylla-go-driver/gocql@${{github.event.pull_request.head.sha}}
make vendor

- name: Setup test environment
run: |
make start-dev-env

- name: Scylla Manager Integration tests
run: |
# make pkg-integration-test PKG=./pkg/ping/cqlping
make pkg-integration-test PKG=./pkg/ping/dynamoping
make pkg-integration-test PKG=./pkg/scyllaclient
# make pkg-integration-test PKG=./pkg/service/backup
make pkg-integration-test PKG=./pkg/service/cluster
make pkg-integration-test PKG=./pkg/service/healthcheck
# make pkg-integration-test PKG=./pkg/service/repair
make pkg-integration-test PKG=./pkg/service/scheduler
make pkg-integration-test PKG=./pkg/store
make pkg-integration-test PKG=./pkg/schema/migrate
make pkg-integration-test PKG=./pkg/util/netwait
4 changes: 2 additions & 2 deletions frame/buffer_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ func (b *Buffer) ReadUDTOption() *UDTOption {
return &UDTOption{
Keyspace: ks,
Name: name,
fieldNames: fn,
fieldTypes: ft,
FieldNames: fn,
FieldTypes: ft,
}
}

Expand Down
4 changes: 2 additions & 2 deletions frame/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ type SetOption struct {
type UDTOption struct {
Keyspace string
Name string
fieldNames []string
fieldTypes []Option
FieldNames []string
FieldTypes []Option
}

// https://github.com/apache/cassandra/blob/adcff3f630c0d07d1ba33bf23fcb11a6db1b9af1/doc/native_protocol_v4.spec#L655-L658
Expand Down
Loading