Skip to content

Commit

Permalink
ci: add ee management mode test (databendlabs#14188)
Browse files Browse the repository at this point in the history
add ee management mode test
  • Loading branch information
zhyass authored Dec 30, 2023
1 parent 5ee08a3 commit 16b0e53
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/actions/test_ee_management_mode_linux/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Test ee management mode"
description: "Running stateless tests in management mode"
inputs:
target:
description: ""
required: true
default: "x86_64-unknown-linux-gnu"
runs:
using: "composite"
steps:
- uses: ./.github/actions/setup_bendsql
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
sha: ${{ github.sha }}
target: ${{ inputs.target }}

- name: Run Stateful Tests with Standalone mode
shell: bash
run: |
./scripts/ci/ci-run-ee-tests-management-mode.sh
22 changes: 22 additions & 0 deletions .github/workflows/reuse.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,28 @@ jobs:
with:
name: test-stateful-standalone-linux

test_ee_management_mode:
needs: [build, check, license]
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
if: needs.license.outputs.license
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_bendsql
- name: Decode license
id: license
run: |
echo "license=$(echo '${{ needs.license.outputs.license }}' | base64 -d)" >> $GITHUB_OUTPUT
- uses: ./.github/actions/test_ee_management_mode_linux
timeout-minutes: 10
env:
DATABEND_ENTERPRISE_LICENSE: ${{ steps.license.outputs.license }}
QUERY_DATABEND_ENTERPRISE_LICENSE: ${{ steps.license.outputs.license }}
- name: Upload failure
if: failure()
uses: ./.github/actions/artifact_failure
with:
name: test-ee-management-mode-linux

sqllogic_ee:
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
if: needs.license.outputs.license
Expand Down
17 changes: 17 additions & 0 deletions scripts/ci/ci-run-ee-tests-management-mode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# Copyright 2020-2021 The Databend Authors.
# SPDX-License-Identifier: Apache-2.0.

set -e

export STORAGE_ALLOW_INSECURE=true

echo "calling test suite"
echo "Starting standalone DatabendQuery(debug)"
./scripts/ci/deploy/databend-query-management-mode.sh

SCRIPT_PATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
cd "$SCRIPT_PATH/../../tests" || exit

echo "Starting databend-test"
./databend-test $1 --mode 'standalone' --run-dir management
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
true
false
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../../../shell_env.sh

echo "drop database if exists db_stream" | $BENDSQL_CLIENT_CONNECT

echo "CREATE DATABASE db_stream" | $BENDSQL_CLIENT_CONNECT
echo "create table db_stream.t(a int)" | $BENDSQL_CLIENT_CONNECT
echo "create stream default.s1 on table db_stream.t comment = 'test'" | $BENDSQL_CLIENT_CONNECT
echo "create stream db_stream.s2 on table db_stream.t comment = 'test'" | $BENDSQL_CLIENT_CONNECT

# When s1 is created, t automatically turns on change tracking. So the offset of s1 and the version of t do not match.
curl -X GET -s http://localhost:8081/v1/tenants/system/stream_status\?stream_name=s1 | jq .has_data
curl -X GET -s http://localhost:8081/v1/tenants/system/stream_status\?stream_name\=s2\&database\=db_stream | jq .has_data

echo "drop stream if exists default.s1" | $BENDSQL_CLIENT_CONNECT
echo "drop stream if exists db_stream.s2" | $BENDSQL_CLIENT_CONNECT
echo "drop table if exists db_stream.t" | $BENDSQL_CLIENT_CONNECT
echo "drop database if exists db_stream" | $BENDSQL_CLIENT_CONNECT

0 comments on commit 16b0e53

Please sign in to comment.