From 208eb6563c788ef3feeb0f1f12f03cf0e940e4ae Mon Sep 17 00:00:00 2001 From: alesapin Date: Tue, 30 Nov 2021 14:40:19 +0300 Subject: [PATCH] Add rest functional tests --- .github/workflows/main.yml | 68 +++++++++++++++++++++++++++++-- .github/workflows/master.yml | 68 +++++++++++++++++++++++++++++-- tests/ci/functional_test_check.py | 12 +++++- 3 files changed, 139 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24b3e178651..cd5fa331026 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -557,10 +557,68 @@ jobs: uses: actions/checkout@v2 - name: Functional test env: - TEMP_PATH: ${{runner.temp}}/stateless_debug + TEMP_PATH: ${{runner.temp}}/stateless_release REPORTS_PATH: ${{runner.temp}}/reports_dir CHECK_NAME: 'Stateless tests (release, actions)' - REPO_COPY: ${{runner.temp}}/stateless_debug/ClickHouse + REPO_COPY: ${{runner.temp}}/stateless_release/ClickHouse + KILL_TIMEOUT: 10800 + run: | + sudo rm -fr $TEMP_PATH + mkdir -p $TEMP_PATH + cp -r $GITHUB_WORKSPACE $TEMP_PATH + cd $REPO_COPY/tests/ci + python3 functional_test_check.py "$CHECK_NAME" $KILL_TIMEOUT + - name: Cleanup + if: always() + run: | + docker kill $(docker ps -q) ||: + docker rm -f $(docker ps -a -q) ||: + sudo rm -fr $TEMP_PATH + FunctionalStatelessTestReleaseDatabaseReplicated: + needs: [BuilderDebRelease] + runs-on: [self-hosted, func-tester] + steps: + - name: Download json reports + uses: actions/download-artifact@v2 + with: + path: ${{runner.temp}}/reports_dir + - name: Check out repository code + uses: actions/checkout@v2 + - name: Functional test + env: + TEMP_PATH: ${{runner.temp}}/stateless_database_replicated + REPORTS_PATH: ${{runner.temp}}/reports_dir + CHECK_NAME: 'Stateless tests (release, DatabaseReplicated, actions)' + REPO_COPY: ${{runner.temp}}/stateless_database_replicated/ClickHouse + KILL_TIMEOUT: 10800 + run: | + sudo rm -fr $TEMP_PATH + mkdir -p $TEMP_PATH + cp -r $GITHUB_WORKSPACE $TEMP_PATH + cd $REPO_COPY/tests/ci + python3 functional_test_check.py "$CHECK_NAME" $KILL_TIMEOUT + - name: Cleanup + if: always() + run: | + docker kill $(docker ps -q) ||: + docker rm -f $(docker ps -a -q) ||: + sudo rm -fr $TEMP_PATH + FunctionalStatelessTestReleaseWideParts: + needs: [BuilderDebRelease] + runs-on: [self-hosted, func-tester] + steps: + - name: Download json reports + uses: actions/download-artifact@v2 + with: + path: ${{runner.temp}}/reports_dir + - name: Check out repository code + uses: actions/checkout@v2 + - name: Functional test + env: + TEMP_PATH: ${{runner.temp}}/stateless_wide_parts + REPORTS_PATH: ${{runner.temp}}/reports_dir + CHECK_NAME: 'Stateless tests (release, wide parts enabled, actions)' + REPO_COPY: ${{runner.temp}}/stateless_wide_parts/ClickHouse KILL_TIMEOUT: 10800 run: | sudo rm -fr $TEMP_PATH @@ -765,10 +823,10 @@ jobs: uses: actions/checkout@v2 - name: Functional test env: - TEMP_PATH: ${{runner.temp}}/stateful_debug + TEMP_PATH: ${{runner.temp}}/stateful_release REPORTS_PATH: ${{runner.temp}}/reports_dir CHECK_NAME: 'Stateful tests (release, actions)' - REPO_COPY: ${{runner.temp}}/stateful_debug/ClickHouse + REPO_COPY: ${{runner.temp}}/stateful_release/ClickHouse KILL_TIMEOUT: 3600 run: | sudo rm -fr $TEMP_PATH @@ -1480,6 +1538,8 @@ jobs: - FastTest - FunctionalStatelessTestDebug - FunctionalStatelessTestRelease + - FunctionalStatelessTestReleaseDatabaseReplicated + - FunctionalStatelessTestReleaseWideParts - FunctionalStatelessTestAsan - FunctionalStatelessTestTsan - FunctionalStatelessTestMsan diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 18969eeedd1..146976ae04c 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -482,10 +482,39 @@ jobs: uses: actions/checkout@v2 - name: Functional test env: - TEMP_PATH: ${{runner.temp}}/stateless_debug + TEMP_PATH: ${{runner.temp}}/stateless_release REPORTS_PATH: ${{runner.temp}}/reports_dir CHECK_NAME: 'Stateless tests (release, actions)' - REPO_COPY: ${{runner.temp}}/stateless_debug/ClickHouse + REPO_COPY: ${{runner.temp}}/stateless_release/ClickHouse + KILL_TIMEOUT: 10800 + run: | + sudo rm -fr $TEMP_PATH + mkdir -p $TEMP_PATH + cp -r $GITHUB_WORKSPACE $TEMP_PATH + cd $REPO_COPY/tests/ci + python3 functional_test_check.py "$CHECK_NAME" $KILL_TIMEOUT + - name: Cleanup + if: always() + run: | + docker kill $(docker ps -q) ||: + docker rm -f $(docker ps -a -q) ||: + sudo rm -fr $TEMP_PATH + FunctionalStatelessTestReleaseDatabaseOrdinary: + needs: [BuilderDebRelease] + runs-on: [self-hosted, func-tester] + steps: + - name: Download json reports + uses: actions/download-artifact@v2 + with: + path: ${{runner.temp}}/reports_dir + - name: Check out repository code + uses: actions/checkout@v2 + - name: Functional test + env: + TEMP_PATH: ${{runner.temp}}/stateless_release_database_ordinary + REPORTS_PATH: ${{runner.temp}}/reports_dir + CHECK_NAME: 'Stateless tests (release, DatabaseOrdinary, actions)' + REPO_COPY: ${{runner.temp}}/stateless_release_database_ordinary/ClickHouse KILL_TIMEOUT: 10800 run: | sudo rm -fr $TEMP_PATH @@ -659,10 +688,39 @@ jobs: uses: actions/checkout@v2 - name: Functional test env: - TEMP_PATH: ${{runner.temp}}/stateful_debug + TEMP_PATH: ${{runner.temp}}/stateful_release REPORTS_PATH: ${{runner.temp}}/reports_dir CHECK_NAME: 'Stateful tests (release, actions)' - REPO_COPY: ${{runner.temp}}/stateful_debug/ClickHouse + REPO_COPY: ${{runner.temp}}/stateful_release/ClickHouse + KILL_TIMEOUT: 3600 + run: | + sudo rm -fr $TEMP_PATH + mkdir -p $TEMP_PATH + cp -r $GITHUB_WORKSPACE $TEMP_PATH + cd $REPO_COPY/tests/ci + python3 functional_test_check.py "$CHECK_NAME" $KILL_TIMEOUT + - name: Cleanup + if: always() + run: | + docker kill $(docker ps -q) ||: + docker rm -f $(docker ps -a -q) ||: + sudo rm -fr $TEMP_PATH + FunctionalStatefulTestReleaseDatabaseOrdinary: + needs: [BuilderDebRelease] + runs-on: [self-hosted, func-tester] + steps: + - name: Download json reports + uses: actions/download-artifact@v2 + with: + path: ${{runner.temp}}/reports_dir + - name: Check out repository code + uses: actions/checkout@v2 + - name: Functional test + env: + TEMP_PATH: ${{runner.temp}}/stateful_release_database_ordinary + REPORTS_PATH: ${{runner.temp}}/reports_dir + CHECK_NAME: 'Stateful tests (release, DatabaseOrdinary, actions)' + REPO_COPY: ${{runner.temp}}/stateful_release_database_ordinary/ClickHouse KILL_TIMEOUT: 3600 run: | sudo rm -fr $TEMP_PATH @@ -1343,12 +1401,14 @@ jobs: - BuilderReport - FunctionalStatelessTestDebug - FunctionalStatelessTestRelease + - FunctionalStatelessTestReleaseDatabaseOrdinary - FunctionalStatelessTestAsan - FunctionalStatelessTestTsan - FunctionalStatelessTestMsan - FunctionalStatelessTestUBsan - FunctionalStatefulTestDebug - FunctionalStatefulTestRelease + - FunctionalStatefulTestReleaseDatabaseOrdinary - FunctionalStatefulTestAsan - FunctionalStatefulTestTsan - FunctionalStatefulTestMsan diff --git a/tests/ci/functional_test_check.py b/tests/ci/functional_test_check.py index a2f42914f64..a69feb0a647 100644 --- a/tests/ci/functional_test_check.py +++ b/tests/ci/functional_test_check.py @@ -19,6 +19,15 @@ from commit_status_helper import post_commit_status, get_commit from clickhouse_helper import ClickHouseHelper, mark_flaky_tests, prepare_tests_results_for_clickhouse from stopwatch import Stopwatch +def get_additional_envs(check_name): + if 'DatabaseReplicated' in check_name: + return ["USE_DATABASE_REPLICATED=1"] + if 'DatabaseOrdinary' in check_name: + return ["USE_DATABASE_ORDINARY=1"] + if 'wide parts enabled' in check_name: + return ["USE_POLYMORPHIC_PARTS=1"] + + return [] def get_image_name(check_name): if 'stateless' in check_name.lower(): @@ -145,7 +154,8 @@ if __name__ == "__main__": run_log_path = os.path.join(result_path, "runlog.log") - run_command = get_run_command(packages_path, result_path, server_log_path, kill_timeout, [], docker_image, flaky_check, tests_to_run) + additional_envs = get_additional_envs(check_name) + run_command = get_run_command(packages_path, result_path, server_log_path, kill_timeout, additional_envs, docker_image, flaky_check, tests_to_run) logging.info("Going to run func tests: %s", run_command) with open(run_log_path, 'w', encoding='utf-8') as log: