Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-808] Add "adapter zone" tests for grants #5437

Closed
10 of 12 tasks
Tracked by #5263
leahwicz opened this issue Jul 5, 2022 · 0 comments · Fixed by #5447
Closed
10 of 12 tasks
Tracked by #5263

[CT-808] Add "adapter zone" tests for grants #5437

leahwicz opened this issue Jul 5, 2022 · 0 comments · Fixed by #5447
Assignees

Comments

@leahwicz
Copy link
Contributor

leahwicz commented Jul 5, 2022

  • test that projects can define grants in 1) the dbt_project.yml, 2) models, seeds, and snapshots, and 3) both the dbt_project.yml and models, seeds, and snapshots and those permissions can be read back directly from the postgres warehouse after a run.
  • test two subsequent runs (dbt build && dbt build) with: same grants; additional grants in second run; fewer grants in second run. Confirm that the final set of grants matches the final configured set of grants in all cases.
    • Special case: grants: {'select': []} in second run. Should revoke all grants, and add none back.
  • For models: tests for view, table, and incremental materializations
  • For incremental: subsequent runs with and without --full-refresh
  • Read back logs and count number of show/grant/revoke statements, to validate that dbt is taking the most efficient possible route — this is half done, would require more logic to handle per-adapter behavior
  • Test cases for known failure conditions:
    • granting to a user/role/group that doesn't exist
    • granting a privilege type that doesn't exist
  • Multiple grantees
  • Multiple privileges

Adapter specific

These tests will need to be defined in each individual adapter plugin, as new tests or extensions of existing "adapter zone" ones

Snowflake

  • Test interaction with copy_grants for view, table, incremental (--full-refresh), seed (--full-refresh)

BigQuery

Spark

  • Test anticipated failure when running against OSS Apache Spark (does not support grant SQL statement)
@github-actions github-actions bot changed the title add tests to the "adapter zone" so that adapters can inherit and run them. Everything should be tested on all 3 model materializations (view + table + incremental) + seeds + snapshots [CT-808] add tests to the "adapter zone" so that adapters can inherit and run them. Everything should be tested on all 3 model materializations (view + table + incremental) + seeds + snapshots Jul 5, 2022
@gshank gshank self-assigned this Jul 5, 2022
@gshank gshank mentioned this issue Jul 6, 2022
6 tasks
@jtcohen6 jtcohen6 changed the title [CT-808] add tests to the "adapter zone" so that adapters can inherit and run them. Everything should be tested on all 3 model materializations (view + table + incremental) + seeds + snapshots [CT-808] Add "adapter zone" tests for grants Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants