Skip to content

Commit c5ae45c

Browse files
Simplify grants tests to use session role directly
- Replace dynamic role discovery with snowflake_session.role - CI environment uses consistent static role configuration - Cleaner and more predictable than SQL queries - Maintains full grants validation functionality - Both tests still pass with proper validation
1 parent 615aa5c commit c5ae45c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests_integration/test_streamlit.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ def test_streamlit_grants_flow(
142142
alter_snowflake_yml,
143143
):
144144
"""Test that streamlit grants are properly applied during deployment."""
145-
# Use current role to avoid role assignment issues in CI
146-
current_role_cursor = snowflake_session.execute_string("SELECT CURRENT_ROLE()")[0]
147-
test_role = current_role_cursor.fetchone()[0]
145+
# Use the session's default role (main CI role)
146+
test_role = snowflake_session.role
148147
entity_id = "app_1"
149148

150149
with project_directory("streamlit_v2"):
@@ -171,9 +170,8 @@ def test_streamlit_grants_experimental_flow(
171170
alter_snowflake_yml,
172171
):
173172
"""Test that streamlit grants are properly applied during experimental deployment."""
174-
# Use current role to avoid role assignment issues in CI
175-
current_role_cursor = snowflake_session.execute_string("SELECT CURRENT_ROLE()")[0]
176-
test_role = current_role_cursor.fetchone()[0]
173+
# Use the session's default role (main CI role)
174+
test_role = snowflake_session.role
177175
entity_id = "app_1"
178176

179177
with project_directory("streamlit_v2"):

0 commit comments

Comments
 (0)