From 9f294d0b53a0b4ffcf7d706e18d47d82d6d4e310 Mon Sep 17 00:00:00 2001 From: "Harris.Chu" <1726587+HarrisChu@users.noreply.github.com> Date: Mon, 27 Jun 2022 13:46:42 +0800 Subject: [PATCH] enhance nightly tck test job (#4355) --- .github/workflows/nightly.yml | 101 ++++++++++++++++++++++++++++++++- .github/workflows/rc.yml | 7 ++- tests/Makefile | 6 +- tests/common/nebula_service.py | 5 ++ tests/nebula-test-run.py | 9 ++- 5 files changed, 119 insertions(+), 9 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f2081951a4d..e12427f1ece 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,7 +2,7 @@ name: nightly on: schedule: - - cron: '0 18 * * *' + - cron: "0 18 * * *" concurrency: group: nightly @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: '^1.16.7' + go-version: "^1.16.7" - name: package run: ./package/package.sh -t Release -r ON -p OFF -s FALSE -k OFF - name: output some vars @@ -199,4 +199,99 @@ jobs: if: ${{ failure() }} with: name: ${{ matrix.os }}-${{ matrix.compiler }}-nebula-test-logs - path: ./build/server_*/logs/ + path: ./build/server_*/logs/ + + test: + name: Tck test + needs: package + runs-on: [self-hosted, nebula] + strategy: + fail-fast: false + matrix: + os: + - ubuntu1804 + - ubuntu2004 + - centos7 + - centos8 + extra_config: + - "ENABLE_SSL=true CA_SIGNED=true QUERY_CONCURRENTLY=false" + - "ENABLE_SSL=false CA_SIGNED=false QUERY_CONCURRENTLY=true" + env: + OSS_DIR: nebula-graph/package/nightly + container: + image: vesoft/nebula-dev:${{ matrix.os }} + steps: + - uses: webiny/action-post-run@2.0.1 + with: + run: sh -c "find . -mindepth 1 -delete" + - uses: actions/checkout@v2 + - name: output some vars + id: vars + env: + SHA_EXT: sha256sum.txt + run: | + subdir=$(date -u +%Y.%m.%d -d "1 days ago") + echo "::set-output name=subdir::$subdir" + + - id: oss_package + run: | + case ${{ matrix.os }} in + ubuntu1804) + echo "::set-output name=p::nebula-graph-${{ steps.vars.outputs.subdir }}-nightly.ubuntu1804.amd64.tar.gz" + ;; + ubuntu2004) + echo "::set-output name=p::nebula-graph-${{ steps.vars.outputs.subdir }}-nightly.ubuntu2004.amd64.tar.gz" + ;; + centos7) + echo "::set-output name=p::nebula-graph-${{ steps.vars.outputs.subdir }}-nightly.el7.x86_64.tar.gz" + ;; + centos8) + echo "::set-output name=p::nebula-graph-${{ steps.vars.outputs.subdir }}-nightly.el8.x86_64.tar.gz" + ;; + esac + - name: Prepare environment + id: prepare + run: | + [ -d build/ ] && rm -rf build/* || mkdir -p build + make init -C tests + - name: CMake + id: cmake + run: | + echo "::set-output name=j::8" + - name: download from oss + run: | + ossutil64 -e ${{ secrets.OSS_ENDPOINT }} \ + -i ${{ secrets.OSS_ID }} \ + -k ${{ secrets.OSS_SECRET }} \ + -f cp oss://${{ env.OSS_DIR }}/${{ steps.vars.outputs.subdir }}/${{ steps.oss_package.outputs.p }} \ + build/. + tar zxvf build/${{ steps.oss_package.outputs.p }} -C build + d=`echo ${{ steps.oss_package.outputs.p }} | sed 's/.tar.gz//'` + mv build/${d}/* build/. + + - name: Setup cluster + run: | + make CONTAINERIZED=true ${{ matrix.extra_config }} up + working-directory: tests/ + timeout-minutes: 2 + - name: Pytest + run: | + make RM_DIR=false DEBUG=false J=${{ steps.cmake.outputs.j }} test + working-directory: tests/ + timeout-minutes: 15 + - name: TCK + run: | + make RM_DIR=false DEBUG=false J=${{ steps.cmake.outputs.j }} tck + working-directory: tests/ + timeout-minutes: 60 + - name: Down cluster + run: | + make RM_DIR=false down + working-directory: tests/ + timeout-minutes: 2 + - name: Upload logs + uses: actions/upload-artifact@v2 + if: ${{ failure() }} + with: + name: ${{ matrix.os }}-${{ matrix.compiler }}-nebula-test-logs + path: ./build/server_*/logs*/ diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 01a82d273ea..d76a5971e79 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -185,6 +185,9 @@ jobs: - ubuntu2004 - centos7 - centos8 + extra_config: + - "ENABLE_SSL=true CA_SIGNED=true QUERY_CONCURRENTLY=false" + - "ENABLE_SSL=false CA_SIGNED=false QUERY_CONCURRENTLY=true" env: OSS_DIR: nebula-graph/rc container: @@ -235,7 +238,7 @@ jobs: - name: Setup cluster run: | - make CONTAINERIZED=true ENABLE_SSL=true CA_SIGNED=true up + make CONTAINERIZED=true ${{ matrix.extra_config }} up working-directory: tests/ timeout-minutes: 2 - name: Pytest @@ -258,4 +261,4 @@ jobs: if: ${{ failure() }} with: name: ${{ matrix.os }}-${{ matrix.compiler }}-nebula-test-logs - path: ./build/server_*/logs/ + path: ./build/server_*/logs*/ diff --git a/tests/Makefile b/tests/Makefile index 39a73466ca1..10624c6b083 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -19,8 +19,7 @@ ENABLE_GRAPH_SSL ?= false ENABLE_META_SSL ?= false CA_SIGNED ?= false CONTAINERIZED ?= false -FAILED_LOGIN_ATTEMPTS ?= 0 -PASSWORD_LOCK_TIME_IN_SECS ?= 0 +QUERY_CONCURRENTLY ?= false # commands gherkin_fmt = ~/.local/bin/reformat-gherkin @@ -74,7 +73,8 @@ up: clean --enable_graph_ssl=$(ENABLE_GRAPH_SSL) \ --enable_meta_ssl=$(ENABLE_META_SSL) \ --ca_signed=$(CA_SIGNED) \ - --containerized=$(CONTAINERIZED) + --containerized=$(CONTAINERIZED) \ + --query_concurrently=$(QUERY_CONCURRENTLY) standalone-up: clean @mkdir -p $(CURR_DIR)/.pytest diff --git a/tests/common/nebula_service.py b/tests/common/nebula_service.py index 5dcb27240c6..e4b45896011 100644 --- a/tests/common/nebula_service.py +++ b/tests/common/nebula_service.py @@ -285,6 +285,11 @@ def _make_params(self, **kwargs): self.graphd_param['max_expression_depth'] = '128' self.storaged_param = copy.copy(_params) + # query_concurrently only work for storaged. + query_concurrently = kwargs.pop("query_concurrently", None) + if query_concurrently: + self.storaged_param["query_concurrently"] = "true" + self.storaged_param['local_config'] = 'false' self.storaged_param['raft_heartbeat_interval_secs'] = '30' self.storaged_param['skip_wait_in_rate_limiter'] = 'true' diff --git a/tests/nebula-test-run.py b/tests/nebula-test-run.py index bf23e452941..af2477babe4 100755 --- a/tests/nebula-test-run.py +++ b/tests/nebula-test-run.py @@ -99,6 +99,12 @@ def init_parser(): default=0, help='how long in seconds to lock the account after too many consecutive login attempts provide an incorrect password', ) + opt_parser.add_option( + '--query_concurrently', + dest='query_concurrently', + default="false", + help='Whether enable storage query_concurrently.', + ) return opt_parser @@ -241,7 +247,8 @@ def stop_nebula(nb, configs=None): enable_graph_ssl=configs.enable_graph_ssl, enable_meta_ssl=configs.enable_meta_ssl, containerized=configs.containerized, - use_standalone=is_standalone + use_standalone=is_standalone, + query_concurrently = configs.query_concurrently, ) if opt_is(configs.cmd, "start"):