Skip to content

Commit 2876871

Browse files
committed
Functional test that demonstrates bug behavior
1 parent e2e86b7 commit 2876871

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

Diff for: tests/functional/partial_parsing/fixtures.py

+26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
macros_sql = """
2+
{% macro foo() %}
3+
foo
4+
{% endmacro %}
5+
6+
{% macro bar() %}
7+
bar
8+
{% endmacro %}
9+
"""
10+
11+
macros_schema1_yml = """
12+
macros:
13+
- name: foo
14+
description: Lorem.
15+
- name: bar
16+
description: Lorem.
17+
"""
18+
19+
macros_schema2_yml = """
20+
macros:
21+
- name: foo
22+
description: Lorem.
23+
- name: bar
24+
description: Lorem ipsum.
25+
"""
26+
127
local_dependency__dbt_project_yml = """
228
329
name: 'local_dep'

Diff for: tests/functional/partial_parsing/test_partial_parsing.py

+22
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@
3939
local_dependency__models__model_to_import_sql,
4040
local_dependency__models__schema_yml,
4141
local_dependency__seeds__seed_csv,
42+
macros_schema1_yml,
43+
macros_schema2_yml,
4244
macros_schema_yml,
45+
macros_sql,
4346
macros_yml,
4447
model_a_sql,
4548
model_b_sql,
@@ -657,6 +660,25 @@ def test_pp_generic_tests(self, project):
657660
assert expected_nodes == list(manifest.nodes.keys())
658661

659662

663+
class TestMacroDescriptionUpdate:
664+
@pytest.fixture(scope="class")
665+
def macros(self):
666+
return {
667+
"macros.sql": macros_sql,
668+
"schema.yml": macros_schema1_yml,
669+
}
670+
671+
def test_pp_model_with_dots(self, project):
672+
# initial parse
673+
run_dbt(["parse"])
674+
675+
# edit YAML in macros-path
676+
write_file(macros_schema2_yml, project.project_root, "macros", "schema.yml")
677+
678+
# parse again
679+
run_dbt(["--partial-parse", "parse"])
680+
681+
660682
class TestExternalModels:
661683
@pytest.fixture(scope="class")
662684
def external_model_node(self):

0 commit comments

Comments
 (0)