-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
hooks for tests #549
Comments
I'm trying to think of a schema test that would be sensitive to environmental variables.. I can't. |
thanks @norton120 -- updated the description accordingly |
I believe this would be a change to the TestRunner somehow adding in the hooks capability from ModelRunner: looks like a big change for a newcomer like myself, any useful tips or things I should really know before trying? e.g. Why was |
Hey @danielerapati - this is a great idea. I think that this would be an incredible feature, and I'd like to integrate it deeper into dbt than just as a post-hook. Presently, post-hooks are kind of a catch-all for things like grants, warehouse operations, etc. This feature is core enough to testing that it would make sense to just build the functionality right into dbt. I made an issue for this over here: #903 Feel free to comment on that with any further thoughts! I'm also happy to discuss potential implementations in that thread :) |
I'm going to close this, as hooks are intended for statements like grants, vacuums, etc. There's some merit to inserting audit records, but I imagine there's a better solution to that than inserting one record at a time... I'm really happy we were able to pull #903 out of this, as I think that will be a really great feature to add some day. Happy to discuss if anyone feels inclined to re-open it! |
@drewbanin I know there has been a lot of discussion around audit logs for tests and the recent PR #3316 by @jtcohen6. However, 4 years have passed since this issue, and there is still no way to write an audit log of which tests were executed when and what the results were. Is there any reason not to have pre- and post-hooks for tests? |
This is still highly needed, especially when tests require access to views that are only available through a secondary role, i.e. if "USE SECONDARY ROLES ALL;" is required as pre_hook. |
@erenelci Someone just opened a related issue over in |
Tests should begin/end with
on-run-start
andon-run-end
The text was updated successfully, but these errors were encountered: