From d3e9be7621f088bf7e5b8ddcc6c7db1a7a2783ba Mon Sep 17 00:00:00 2001 From: disksing Date: Sun, 20 Jun 2021 13:28:34 +0800 Subject: [PATCH] add integration test with tikv (#92) Signed-off-by: disksing --- .github/workflows/integration.yml | 47 +++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 11 +++----- .github/workflows/test.yml | 8 ++---- integration_tests/tikv.toml | 10 +++++++ 4 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/integration.yml create mode 100644 integration_tests/tikv.toml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 00000000..c5f13ce8 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,47 @@ +name: Integration Test + +on: + push: + branches: [ v2 ] + pull_request: + branches: [ v2 ] + +jobs: + integration-tikv: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - name: Fetch PD + uses: shrink/actions-docker-extract@v1 + id: extract-pd + with: + image: pingcap/pd:nightly + path: /pd-server + + - name: Fetch TiKV + uses: shrink/actions-docker-extract@v1 + id: extract-tikv + with: + image: pingcap/tikv:nightly + path: /tikv-server + + - name: Run PD & TiKV + run: | + mv ../${{steps.extract-pd.outputs.destination}}/pd-server . + mv ../${{steps.extract-tikv.outputs.destination}}/tikv-server . + ./pd-server > pd.log 2>&1 & + sleep 5 + ./tikv-server -C tikv.toml > tikv.log 2>&1 & + sleep 15 + working-directory: integration_tests + - name: Test + run: go test -v --with-tikv=true --pd-addrs=127.0.0.1:2379 + working-directory: integration_tests + diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 58bd3d78..63463c53 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: golangci-lint +name: Lint on: push: branches: @@ -6,20 +6,17 @@ on: pull_request: jobs: golangci: - name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 - name: Set up Go uses: actions/setup-go@v2 with: go-version: 1.16 - - name: Tidy - run: go mod tidy - - - name: golangci-lint + - name: Lint uses: golangci/golangci-lint-action@v2 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 756c210c..41016ae2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Go +name: Unit Test on: push: @@ -7,8 +7,7 @@ on: branches: [ v2 ] jobs: - - build: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -18,8 +17,5 @@ jobs: with: go-version: 1.16 - - name: Tidy - run: go mod tidy - - name: Test run: go test -v ./... diff --git a/integration_tests/tikv.toml b/integration_tests/tikv.toml new file mode 100644 index 00000000..8dc0b812 --- /dev/null +++ b/integration_tests/tikv.toml @@ -0,0 +1,10 @@ +[server] +addr = "127.0.0.1:20160" +[storage] +reserve-space = "1MB" +[pd] +endpoints = ["127.0.0.1:2379"] +[rocksdb] +max-open-files = 10000 +[raftdb] +max-open-files = 10000