-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial schema, storage provider and quota manager for CockroachDB (
#2834) This creates an initial schema for CRDB by mirroring a lot of the existing constructs from the MySQL storage provider. It also adds scripts and test code to run unit and integration tests with CockRoachDB While this lead to a lot of code duplication, the intention is to address that in a separate PR in order to keep the work separated into logical batches. Doing all the refactoring to create common constructs for SQL backends would lead to a patch too big for folks to review in a reasonable time and would create more risk. Signed-off-by: Juan Antonio Osorio <[email protected]>
- Loading branch information
Showing
35 changed files
with
4,595 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
name: Test CRDB | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- uses: golangci/golangci-lint-action@v3 | ||
with: | ||
args: ./storage/crdb | ||
|
||
unit-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.19' | ||
check-latest: true | ||
cache: true | ||
|
||
- name: Run tests | ||
run: go test -v ./storage/crdb/... ./quota/crdbqm/... | ||
|
||
integration: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.19' | ||
check-latest: true | ||
cache: true | ||
|
||
- name: Build before tests | ||
run: go mod download && go build ./... | ||
|
||
- name: Run CockroachDB | ||
run: docker run --rm -d --name=roach -p 8080:8080 -p 26257:26257 -v "${PWD}/cockroach-data:/cockroach/cockroach-data" cockroachdb/cockroach:latest start-single-node --insecure | ||
|
||
- name: Wait for CockroachDB | ||
uses: nick-fields/retry@v2 | ||
with: | ||
timeout_seconds: 15 | ||
max_attempts: 3 | ||
retry_on: error | ||
command: docker exec roach ./cockroach sql --insecure -e "SELECT 1" | ||
|
||
- name: Get crdb logs | ||
run: docker logs roach | ||
|
||
- name: Run tests | ||
run: ./integration/integration_test.sh | ||
env: | ||
TEST_COCKROACHDB_URI: postgresql://root@localhost:26257/defaultdb?sslmode=disable | ||
CRDB_IN_CONTAINER: true | ||
CRDB_CONTAINER_NAME: roach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ | |
/trillian_log_signer | ||
/trillian_map_server | ||
default.etcd | ||
cockroach-data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.