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

Convert threading tests to pytest #6226

Merged
merged 2 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions .changes/unreleased/Under the Hood-20221108-074550.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Under the Hood
body: Convert threading tests to pytest
time: 2022-11-08T07:45:50.589147-06:00
custom:
Author: stu-k
Issue: "5942"
PR: "6226"
Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions test/integration/031_thread_count_tests/test_thread_count.py

This file was deleted.

46 changes: 46 additions & 0 deletions tests/functional/threading/test_thread_count.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import pytest
from dbt.tests.util import run_dbt


models__do_nothing__sql = """
with x as (select pg_sleep(1)) select 1
"""


class TestThreadCount:
@pytest.fixture(scope="class")
def models(self):
return {
"do_nothing_1.sql": models__do_nothing__sql,
"do_nothing_2.sql": models__do_nothing__sql,
"do_nothing_3.sql": models__do_nothing__sql,
"do_nothing_4.sql": models__do_nothing__sql,
"do_nothing_5.sql": models__do_nothing__sql,
"do_nothing_6.sql": models__do_nothing__sql,
"do_nothing_7.sql": models__do_nothing__sql,
"do_nothing_8.sql": models__do_nothing__sql,
"do_nothing_9.sql": models__do_nothing__sql,
"do_nothing_10.sql": models__do_nothing__sql,
"do_nothing_11.sql": models__do_nothing__sql,
"do_nothing_12.sql": models__do_nothing__sql,
"do_nothing_13.sql": models__do_nothing__sql,
"do_nothing_14.sql": models__do_nothing__sql,
"do_nothing_15.sql": models__do_nothing__sql,
"do_nothing_16.sql": models__do_nothing__sql,
"do_nothing_17.sql": models__do_nothing__sql,
"do_nothing_18.sql": models__do_nothing__sql,
"do_nothing_19.sql": models__do_nothing__sql,
"do_nothing_20.sql": models__do_nothing__sql,
}

@pytest.fixture(scope="class")
def project_config_update(self):
return {"config-version": 2}

@pytest.fixture(scope="class")
def profiles_config_update(self):
return {"threads": 2}

def test_threading_8x(self, project):
results = run_dbt(args=["run", "--threads", "16"])
assert len(results), 20