Skip to content

Commit

Permalink
feat: add go sdk tests (apache#686)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 authored Mar 3, 2023
1 parent fa93d9d commit cff7c77
Show file tree
Hide file tree
Showing 4 changed files with 465 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,53 @@ jobs:
path: |
/tmp/ceresdb-stdout.log
/tmp/ceresdb-stderr.log
sdk-test:
name: sdk-test
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
rust: [ nightly-2022-08-08 ]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache Rust Dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo
./target
key: debug-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-${{ hashFiles('Cargo.lock') }}
restore-keys: |
debug-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-
debug-${{ runner.os }}-
debug-
- run: |
rustup set auto-self-update disable
rustup toolchain install ${{ matrix.rust }} --profile minimal
- name: Release Disk Quota
run: |
sudo rm -rf /usr/local/lib/android # release about 10 GB
sudo rm -rf /usr/share/dotnet # release about 20GB
- name: Setup Build Environment
run: |
sudo apt update
sudo apt install --yes protobuf-compiler
- name: Build and Run CeresDB
run: |
make build-debug
nohup ./target/debug/ceresdb-server -c docs/minimal.toml > /tmp/ceresdb-stdout.log &
sleep 10
- name: Run Go SDK tests
working-directory: integration_tests/sdk/go
run: |
go run main.go
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v3
with:
name: sdk-test-${{ github.head_ref }}.${{ github.sha }}
path: |
/tmp/ceresdb-stdout.log
22 changes: 22 additions & 0 deletions integration_tests/sdk/go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module go-sdk-test

go 1.17

require github.com/CeresDB/ceresdb-client-go v1.1.0

require (
github.com/CeresDB/ceresdbproto/golang v0.0.0-20230228090856-37ba6214b131 // indirect
github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/flatbuffers v2.0.0+incompatible // indirect
github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/klauspost/compress v1.15.14 // indirect
github.com/pierrec/lz4/v4 v4.1.8 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
)
Loading

0 comments on commit cff7c77

Please sign in to comment.