Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(sqllogictest): add sqllogic tests for management mode #9683

Merged
merged 8 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/actions/test_sqllogic_management_mode_linux/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Test sqllogic management mode"
description: "Running sqllogic tests in management mode"
inputs:
profile:
description: "The profile for this test"
required: true
default: "debug"
target:
description: ""
required: true
default: "x86_64-unknown-linux-gnu"
dirs:
description: "logic test suites dirs"
required: true
default: ""
handlers:
description: "logic test handlers, mysql,http,clickhouse"
required: false
default: ""
runs:
using: "composite"
steps:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}
- name: Run sqllogic Tests with management mode
shell: bash
env:
TEST_HANDLERS: ${{ inputs.handlers }}
run: bash ./scripts/ci/ci-run-sqllogic-tests-management-mode.sh
18 changes: 18 additions & 0 deletions .github/workflows/dev-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,24 @@ jobs:
dirs: ${{ matrix.dirs }}
handlers: ${{ matrix.handlers }}

test_sqllogic_management_mode_linux:
timeout-minutes: 30
name: test_sqllogic_${{ matrix.dirs }}_linux
runs-on: [ self-hosted, X64, Linux, development ]
needs: build_gnu
strategy:
matrix:
dirs:
- "management"
handlers:
- "mysql,http,clickhouse"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test_sqllogic_management_mode_linux
with:
dirs: ${{ matrix.dirs }}
handlers: ${{ matrix.handlers }}

test_sqllogic_cluster_linux:
timeout-minutes: 30
name: test_sqllogic_${{ matrix.dirs }}_cluster_linux
Expand Down
20 changes: 20 additions & 0 deletions scripts/ci/ci-run-sqllogic-tests-management-mode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Copyright 2020-2021 The Databend Authors.
# SPDX-License-Identifier: Apache-2.0.

set -e

echo "Starting standalone DatabendQuery and DatabendMeta"
./scripts/ci/deploy/databend-query-management-mode.sh

TEST_HANDLERS=${TEST_HANDLERS:-"mysql,http,clickhouse"}
BUILD_PROFILE=${BUILD_PROFILE:-debug}

RUN_DIR=""
if [ $# -gt 0 ]; then
RUN_DIR="--run_dir $*"
fi
echo "Run suites using argument: $RUN_DIR"

echo "Starting databend-sqllogic tests"
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --enable_sandbox --debug
6 changes: 4 additions & 2 deletions scripts/ci/deploy/databend-query-management-mode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ nohup target/${BUILD_PROFILE}/databend-meta --single --log-level=ERROR &
echo "Waiting on databend-meta 10 seconds..."
python3 scripts/ci/wait_tcp.py --timeout 5 --port 9191

echo 'Start databend-query...'
echo 'Start databend-query management-mode node'
nohup target/${BUILD_PROFILE}/databend-query -c scripts/ci/deploy/config/databend-query-management-mode.toml &
echo "Waiting on databend-query 10 seconds..."
python3 scripts/ci/wait_tcp.py --timeout 5 --port 3307
python3 scripts/ci/wait_tcp.py --timeout 5 --port 9091

echo "All done..."
23 changes: 23 additions & 0 deletions tests/sqllogictests/suites/management/management_calls
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
statement ok
DROP TABLE if EXISTS call_t

statement ok
CREATE TABLE call_t(a UInt64 null, b UInt32 null) CLUSTER BY(a+1) Engine = Fuse

# need to check the result later, currently just use ok to skip
onlyif todo
statement ok
call system$search_tables('call_t')


query T
call system$clustering_information('default', 'call_t')
----
((a + 1)) 0 0 0.0 0.0 {}


query T
call admin$tenant_quota('admin')
----
0 0 0 0