Skip to content

Commit

Permalink
add dbt show tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Sep 18, 2023
1 parent 9fa8de2 commit 2adac33
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# install latest changes in dbt-core
# TODO: how to automate switching from develop to version branches?
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter
git+https://github.com/dbt-labs/dbt-core.git@8496/limit-in-show-query#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git@8496/limit-in-show-query#egg=dbt-tests-adapter&subdirectory=tests/adapter

# if version 1.x or greater -> pin to major version
# if version 0.x -> pin to minor
Expand Down
27 changes: 27 additions & 0 deletions tests/functional/adapter/dbt_show/test_dbt_show.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import pytest
from dbt.tests.adapter.dbt_show.test_dbt_show import BaseShowSqlHeader, BaseShowLimit


my_model_sql_header_sql = """
{{
config(
materialized = "table"
)
}}
{% call set_sql_header(config) %}
SET MY_VARIABLE='test';
{% endcall %}
SELECT $MY_VARIABLE as column_name
"""


class TestBigQueryShowLimit(BaseShowLimit):
pass


class TestBigQueryShowSqlHeader(BaseShowSqlHeader):
@pytest.fixture(scope="class")
def models(self):
return {
"sql_header.sql": my_model_sql_header_sql,
}

0 comments on commit 2adac33

Please sign in to comment.