Skip to content

Commit

Permalink
enhance nightly tck test job (#4355)
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisChu authored and Sophie-Xie committed Jun 30, 2022
1 parent dfe737c commit 9f294d0
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 9 deletions.
101 changes: 98 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: nightly

on:
schedule:
- cron: '0 18 * * *'
- cron: "0 18 * * *"

concurrency:
group: nightly
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/[email protected]
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*/
7 changes: 5 additions & 2 deletions .github/workflows/rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -258,4 +261,4 @@ jobs:
if: ${{ failure() }}
with:
name: ${{ matrix.os }}-${{ matrix.compiler }}-nebula-test-logs
path: ./build/server_*/logs/
path: ./build/server_*/logs*/
6 changes: 3 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions tests/common/nebula_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
9 changes: 8 additions & 1 deletion tests/nebula-test-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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"):
Expand Down

0 comments on commit 9f294d0

Please sign in to comment.