Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add functional test
  • Loading branch information
jtcohen6 committed Jun 9, 2023
commit 21e08d88c1d53b4d222d611e159568fbddd007dd
12 changes: 12 additions & 0 deletions tests/functional/show/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
select current_setting('timezone') as timezone
"""

private_model_yml = """
groups:
- name: my_cool_group
owner: {name: me}

models:
- name: private_model
access: private
config:
group: my_cool_group
"""


schema_yml = """
models:
Expand Down
18 changes: 18 additions & 0 deletions tests/functional/show/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
models__ephemeral_model,
schema_yml,
models__sql_header,
private_model_yml,
)


Expand Down Expand Up @@ -137,3 +138,20 @@ def test_none(self, project):
(results, log_output) = run_dbt_and_capture(["show", "--select", "sample_model.v2"])
assert "Previewing node 'sample_model.v1'" not in log_output
assert "Previewing node 'sample_model.v2'" in log_output


class TestShowPrivateModel:
@pytest.fixture(scope="class")
def models(self):
return {
"schema.yml": private_model_yml,
"private_model.sql": models__sample_model,
}

@pytest.fixture(scope="class")
def seeds(self):
return {"sample_seed.csv": seeds__sample_seed}

def test_version_unspecified(self, project):
run_dbt(["build"])
run_dbt(["show", "--inline", "select * from {{ ref('private_model') }}"])