Skip to content

Commit 769e2b4

Browse files
committed
Increase timeout time for individual tests. Do tests with Github runner + azure instance
1 parent 2da0ade commit 769e2b4

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

.github/workflows/test_cloud.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,43 @@
22
name: "test_cloud"
33

44
on: # yamllint disable-line rule:truthy
5-
pull_request:
6-
branches:
7-
- '*_cloud'
85
workflow_dispatch:
6+
pull_request:
7+
branches: main
98
schedule:
109
- cron: '0 2 * * *' # Nightly run at 2:00 AM UTC
1110

1211
jobs:
1312
cloud_smt_tests:
1413
name: ClickHouse Cloud SharedMergeTree Tests
1514
runs-on: ubuntu-latest
15+
timeout-minutes: 90
1616

1717
env:
1818
PYTHONPATH: dbt
19-
DBT_CH_TEST_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}
20-
DBT_CH_TEST_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}
19+
DBT_CH_TEST_HOST: ${{ secrets.DBT_TESTS_CLOUD_HOST_SMT }}
20+
DBT_CH_TEST_PASSWORD: ${{ secrets.DBT_TESTS_CLOUD_PASSWORD_SMT }}
2121
DBT_CH_TEST_CLUSTER_MODE: true
2222
DBT_CH_TEST_CLOUD: true
2323

2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@v3
2727

28-
- name: Setup Python 3.11
28+
- name: Setup Python 3.12
2929
uses: actions/setup-python@v4
3030
with:
31-
python-version: '3.11'
31+
python-version: '3.12'
3232

3333
- name: Install requirements
3434
run: pip3 install -r dev_requirements.txt
3535

3636
- name: Run HTTP tests
3737
env:
3838
DBT_CH_TEST_PORT: 8443
39-
run: pytest tests
39+
run: pytest tests --timeout=240
4040

4141
- name: Run Native tests
4242
env:
4343
DBT_CH_TEST_PORT: 9440
44-
run: pytest tests
44+
run: pytest tests --timeout=240

tests/integration/adapter/materialized_view/test_materialized_view.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pytest
99
from dbt.adapters.clickhouse.query import quote_identifier
1010
from dbt.tests.util import check_relation_types, run_dbt
11+
from dbt.tests.fixtures.project import TestProjInfo
1112

1213
PEOPLE_SEED_CSV = """
1314
id,name,age,department
@@ -193,14 +194,14 @@ def test_disabled_catchup(self, project):
193194
"""
194195

195196

196-
def query_table_type(project, schema, table):
197+
def query_table_type(project: TestProjInfo, schema: str, table: str) -> str:
197198
table_type = project.run_sql(
198199
f"""
199200
select engine from system.tables where database = '{schema}' and name = '{table}'
200201
""",
201202
fetch="all",
202203
)
203-
return table_type[0][0] if len(table_type) > 0 else None
204+
return table_type[0][0] if len(table_type) > 0 else ''
204205

205206

206207
class TestUpdateMV:
@@ -287,7 +288,7 @@ def test_mv_is_dropped_on_full_refresh(self, project):
287288
assert len(results) == 2 # will include also a view for the other test.
288289

289290
# Verify both tables were created correctly
290-
assert query_table_type(project, schema_unquoted, 'hackers_mv') == "MergeTree"
291+
assert query_table_type(project, schema_unquoted, 'hackers_mv').endswith("MergeTree")
291292
assert query_table_type(project, schema_unquoted, 'hackers_mv_mv') == "MaterializedView"
292293

293294
# Step 3: Change model to view materialization and run with full refresh
@@ -300,7 +301,7 @@ def test_mv_is_dropped_on_full_refresh(self, project):
300301
# Step 4: Assert that target table is now a view and internal MV no longer exists
301302
assert query_table_type(project, schema_unquoted, 'hackers_mv') == "View"
302303
# Verify that the internal materialized view (_mv) no longer exists
303-
assert query_table_type(project, schema_unquoted, 'hackers_mv_mv') is None
304+
assert not query_table_type(project, schema_unquoted, 'hackers_mv_mv')
304305

305306
def test_view_full_refresh_does_not_affect_existing_mv_with_mv_suffix(self, project):
306307
"""
@@ -321,7 +322,7 @@ def test_view_full_refresh_does_not_affect_existing_mv_with_mv_suffix(self, proj
321322

322323
# Verify both models were created correctly
323324
assert query_table_type(project, schema_unquoted, 'hackers') == "View"
324-
assert query_table_type(project, schema_unquoted, 'hackers_mv') == "MergeTree"
325+
assert query_table_type(project, schema_unquoted, 'hackers_mv').endswith("MergeTree")
325326
assert query_table_type(project, schema_unquoted, 'hackers_mv_mv') == "MaterializedView"
326327

327328
# Verify data is present in both
@@ -341,7 +342,7 @@ def test_view_full_refresh_does_not_affect_existing_mv_with_mv_suffix(self, proj
341342
assert result[0][0] == 3
342343

343344
# Verify that hackers_mv and hackers_mv_mv are still present and working
344-
assert query_table_type(project, schema_unquoted, 'hackers_mv') == "MergeTree"
345+
assert query_table_type(project, schema_unquoted, 'hackers_mv').endswith("MergeTree")
345346
assert query_table_type(project, schema_unquoted, 'hackers_mv_mv') == "MaterializedView"
346347

347348
result = project.run_sql(f"select count(*) from {schema_unquoted}.hackers_mv", fetch="all")

0 commit comments

Comments
 (0)