Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Fix functional partial_parsing tests
  • Loading branch information
QMalcolm committed Jul 11, 2023
commit 10f1c269c0df2c0b7bd1b1a2de33c9737dac1c34
10 changes: 6 additions & 4 deletions tests/functional/partial_parsing/test_pp_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from dbt.tests.util import run_dbt, write_file, get_manifest
from tests.functional.partial_parsing.fixtures import (
people_sql,
metricflow_time_spine_sql,
people_semantic_models_yml,
people_metrics_yml,
people_metrics2_yml,
Expand All @@ -18,14 +19,15 @@ class TestMetrics:
def models(self):
return {
"people.sql": people_sql,
"metricflow_time_spine.sql": metricflow_time_spine_sql,
}

def test_metrics(self, project):
# initial run
results = run_dbt(["run"])
assert len(results) == 1
assert len(results) == 2
manifest = get_manifest(project.project_root)
assert len(manifest.nodes) == 1
assert len(manifest.nodes) == 2

# Add metrics yaml file (and necessary semantic models yaml)
write_file(
Expand All @@ -36,7 +38,7 @@ def test_metrics(self, project):
)
write_file(people_metrics_yml, project.project_root, "models", "people_metrics.yml")
results = run_dbt(["run"])
assert len(results) == 1
assert len(results) == 2
manifest = get_manifest(project.project_root)
assert len(manifest.metrics) == 2
metric_people_id = "metric.test.number_of_people"
Expand All @@ -55,7 +57,7 @@ def test_metrics(self, project):
# Change metrics yaml files
write_file(people_metrics2_yml, project.project_root, "models", "people_metrics.yml")
results = run_dbt(["run"])
assert len(results) == 1
assert len(results) == 2
manifest = get_manifest(project.project_root)
metric_people = manifest.metrics[metric_people_id]
expected_meta = {"my_meta": "replaced"}
Expand Down