-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9eb32ea
commit 92b1751
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
|
||
from dbt.tests.util import run_dbt | ||
|
||
|
||
class TestDatabaseRole: | ||
""" | ||
This test addresses https://github.com/dbt-labs/dbt-snowflake/issues/1151 | ||
Run this manually while investigating: | ||
CREATE DATABASE ROLE BLOCKING_DB_ROLE; | ||
GRANT ALL PRIVILEGES ON FUTURE TABLES IN DATABASE DBT_TEST TO DATABASE ROLE BLOCKING_DB_ROLE; | ||
""" | ||
|
||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return {"my_table.sql": "{{ config(materialized='table') }} select 1 as id"} | ||
|
||
@pytest.fixture(scope="class") | ||
def project_config_update(self): | ||
return {"models": {"copy_grants": True}} | ||
|
||
def test_database_role(self, project): | ||
run_dbt(["run"]) | ||
run_dbt(["run"]) | ||
run_dbt(["run", "--full-refresh"]) |