From c6517a83551563575f8d51b67260bf72c7613eed Mon Sep 17 00:00:00 2001 From: bentsileviav Date: Sun, 10 Mar 2024 15:54:55 +0200 Subject: [PATCH 1/4] Add SMT tests job --- .github/workflows/test_cloud.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/test_cloud.yml b/.github/workflows/test_cloud.yml index d6403b1d..617a03d2 100644 --- a/.github/workflows/test_cloud.yml +++ b/.github/workflows/test_cloud.yml @@ -40,3 +40,35 @@ jobs: env: DBT_CH_TEST_PORT: 9440 run: pytest tests + cloud_smt_tests: + name: ClickHouse Cloud SharedMergeTree Tests + runs-on: ubuntu-latest + + env: + PYTHONPATH: dbt + DBT_CH_TEST_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }} + DBT_CH_TEST_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }} + DBT_CH_TEST_CLUSTER_MODE: true + DBT_CH_TEST_CLOUD: true + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install requirements + run: pip3 install -r dev_requirements.txt + + - name: Run HTTP tests + env: + DBT_CH_TEST_PORT: 8443 + run: pytest tests + + - name: Run Native tests + env: + DBT_CH_TEST_PORT: 9440 + run: pytest tests From 61f814d8a9ac3d1136bf2c7f8481943b10e5adc0 Mon Sep 17 00:00:00 2001 From: bentsileviav Date: Wed, 8 May 2024 15:55:23 +0200 Subject: [PATCH 2/4] No need to provide host and port, as we run it with the configured adapter credentials (which is the same as provided) --- .../clickhouse/macros/materializations/dictionary.sql | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dbt/include/clickhouse/macros/materializations/dictionary.sql b/dbt/include/clickhouse/macros/materializations/dictionary.sql index ef8e64e5..ed41f579 100644 --- a/dbt/include/clickhouse/macros/materializations/dictionary.sql +++ b/dbt/include/clickhouse/macros/materializations/dictionary.sql @@ -89,12 +89,6 @@ {% if credentials.get("database") != '' -%} db '{{ credentials.get("database") }}' {%- endif %} - {% if credentials.get("host") != '' and credentials.get("host") != 'localhost' -%} - host '{{ credentials.get("host") }}' - {% if credentials.get("port") != '' -%} - port '{{ credentials.get("port") }}' - {%- endif %} - {%- endif %} {%- if table is not none %} table '{{ table }}' {% else %} From 7bfc61b849bf98d1271545ee61b71b6c343f8cd6 Mon Sep 17 00:00:00 2001 From: bentsileviav Date: Thu, 6 Jun 2024 10:33:15 +0300 Subject: [PATCH 3/4] skip comment tests on cloud --- tests/integration/adapter/persist_docs/test_persist_docs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/integration/adapter/persist_docs/test_persist_docs.py b/tests/integration/adapter/persist_docs/test_persist_docs.py index a9129a3b..58c1ae78 100644 --- a/tests/integration/adapter/persist_docs/test_persist_docs.py +++ b/tests/integration/adapter/persist_docs/test_persist_docs.py @@ -179,6 +179,9 @@ def project_config_update(self): @pytest.fixture(scope="class") def run_has_comments(self, project): + if os.environ.get('DBT_CH_TEST_CLOUD', '').lower() in ('1', 'true', 'yes'): + pytest.skip('Not running comment test for cloud') + def fixt(): run_dbt() run_dbt(["docs", "generate"]) From fe26a9327f50562e7cc5cdcbf9d8ba2d7cf33292 Mon Sep 17 00:00:00 2001 From: bentsileviav Date: Sun, 9 Jun 2024 16:07:34 +0300 Subject: [PATCH 4/4] remove old cloud job, as all new tables are SMT by default --- .github/workflows/test_cloud.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/.github/workflows/test_cloud.yml b/.github/workflows/test_cloud.yml index 4d48c489..42c62baa 100644 --- a/.github/workflows/test_cloud.yml +++ b/.github/workflows/test_cloud.yml @@ -8,38 +8,6 @@ on: # yamllint disable-line rule:truthy workflow_dispatch: jobs: - cloud_tests: - name: ClickHouse Cloud Tests - runs-on: ubuntu-latest - - env: - PYTHONPATH: dbt - DBT_CH_TEST_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST }} - DBT_CH_TEST_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD }} - DBT_CH_TEST_CLUSTER_MODE: true - DBT_CH_TEST_CLOUD: true - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install requirements - run: pip3 install -r dev_requirements.txt - - - name: Run HTTP tests - env: - DBT_CH_TEST_PORT: 8443 - run: pytest tests - - - name: Run Native tests - env: - DBT_CH_TEST_PORT: 9440 - run: pytest tests cloud_smt_tests: name: ClickHouse Cloud SharedMergeTree Tests runs-on: ubuntu-latest