From 92b1751252c6a1a90eee4b552cd4e8731b34d32f Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 24 Sep 2024 15:10:40 -0400 Subject: [PATCH] publish failed reproduction case --- .../auth_tests/test_database_role.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/functional/auth_tests/test_database_role.py diff --git a/tests/functional/auth_tests/test_database_role.py b/tests/functional/auth_tests/test_database_role.py new file mode 100644 index 000000000..882a2de2e --- /dev/null +++ b/tests/functional/auth_tests/test_database_role.py @@ -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"])