Skip to content

Commit cd39b36

Browse files
committed
add concurrency test
1 parent 874ea3f commit cd39b36

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from dbt.tests.adapter.concurrency.test_concurrency import BaseConcurrency, seeds__update_csv
2+
from dbt.tests.util import (
3+
check_relations_equal,
4+
check_table_does_not_exist,
5+
rm_file,
6+
run_dbt,
7+
run_dbt_and_capture,
8+
write_file,
9+
)
10+
11+
12+
class TestConcurenncySQLServer(BaseConcurrency):
13+
def test_concurrency(self, project):
14+
run_dbt(["seed", "--select", "seed"])
15+
results = run_dbt(["run"], expect_pass=False)
16+
assert len(results) == 7
17+
check_relations_equal(project.adapter, ["seed", "view_model"])
18+
check_relations_equal(project.adapter, ["seed", "dep"])
19+
check_relations_equal(project.adapter, ["seed", "table_a"])
20+
check_relations_equal(project.adapter, ["seed", "table_b"])
21+
check_table_does_not_exist(project.adapter, "invalid")
22+
check_table_does_not_exist(project.adapter, "skip")
23+
24+
rm_file(project.project_root, "seeds", "seed.csv")
25+
write_file(seeds__update_csv, project.project_root, "seeds", "seed.csv")
26+
27+
results, output = run_dbt_and_capture(["run"], expect_pass=False)
28+
assert len(results) == 7
29+
check_relations_equal(project.adapter, ["seed", "view_model"])
30+
check_relations_equal(project.adapter, ["seed", "dep"])
31+
check_relations_equal(project.adapter, ["seed", "table_a"])
32+
check_relations_equal(project.adapter, ["seed", "table_b"])
33+
check_table_does_not_exist(project.adapter, "invalid")
34+
check_table_does_not_exist(project.adapter, "skip")
35+
36+
assert "PASS=5 WARN=0 ERROR=1 SKIP=1 TOTAL=7" in output

0 commit comments

Comments
 (0)