-
Notifications
You must be signed in to change notification settings - Fork 422
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
fix: Fix QUOTED_IDENTIFIERS_IGNORE_CASE parameter test #2841
Conversation
Integration tests success for fa774500942c2b3cb0d791cadb0299732d5905c6 |
func sessionParameterOnUser(userName string) string { | ||
return fmt.Sprintf( | ||
` | ||
resource "snowflake_user" "u" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we supposed to use helpers for such things? I mean https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/jmichalak-security-integrations/pkg/acceptance/helpers/user_client.go#L27.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no "rule" if we should prefer helper over tf config. The rule of thumb should be: what is more readable? In this case, the user resource is really simple to set up, so both options would be good. It's a bit hard now to get the id of the helper-generated user to put it into config (because of how tf tests are run - we will address this in the future, maybe on one of the happy Fridays), and as you can see there is no method to create with name (and these methods should be avoided for various cases, mostly because it opens a way to use id that is not the generated one), that's why I went with user in tf config.
Setting `QUOTED_IDENTIFIERS_IGNORE_CASE` in `TestAcc_Parameters_QuotedIdentifiersIgnoreCaseCanBeSet` was interfering with the tests being run on other branches. It resulted in seemingly random `Database 'XYZ' does not exist or not authorized` errors for database that exists, works moments before and moments after. Sequence of example statements: ``` -- 2024-05-28 11:28:34.634 +0000 -- CREATE MATERIALIZED VIEW "int_test_db_IT_C0E0DFE82EF6223390C3723866862A273A406F10"."int_test_sc_IT_C0E0DFE82EF6223390C3723866862A273A406F10"."AFKRZIIT_C0E0DFE82EF6223390C3723866862A273A406F10" CLUSTER BY ("ID") AS SELECT id FROM "int_test_db_IT_C0E0DFE82EF6223390C3723866862A273A406F10"."int_test_sc_IT_C0E0DFE82EF6223390C3723866862A273A406F10"."VYODPJIT_C0E0DFE82EF6223390C3723866862A273A406F10" ... -- 2024-05-28 11:28:35.019 +0000 -- ALTER ACCOUNT SET QUOTED_IDENTIFIERS_IGNORE_CASE = true ... -- 2024-05-28 11:28:35.123 +0000 -- SHOW MATERIALIZED VIEWS LIKE 'AFKRZIIT_C0E0DFE82EF6223390C3723866862A273A406F10' IN SCHEMA "int_test_db_IT_C0E0DFE82EF6223390C3723866862A273A406F10"."int_test_sc_IT_C0E0DFE82EF6223390C3723866862A273A406F10" ``` What was done: - test `TestAcc_Parameters_QuotedIdentifiersIgnoreCaseCanBeSet` creates new user and sets the `QUOTED_IDENTIFIERS_IGNORE_CASE` parameter on it - fail-fast guards added to integration and acceptance tests setups to prevent running tests when `QUOTED_IDENTIFIERS_IGNORE_CASE` is set to true initially
🤖 I have created a release *beep* *boop* --- ## [0.92.0](v0.91.0...v0.92.0) (2024-06-06) ### 🎉 **What's new:** * Add Api Authentication security integration to sdk ([#2840](#2840)) ([57a07ee](57a07ee)) * Add External Oauth security integration to sdk ([#2835](#2835)) ([82d1c09](82d1c09)) * add network rules ([#2746](#2746)) ([c79fa29](c79fa29)) * Add SCIM and SAML2 security integrations to sdk ([#2799](#2799)) ([1312ff1](1312ff1)) * Add Snowflake Oauth security integration to sdk ([#2830](#2830)) ([b576f29](b576f29)) * Database resource v1 readiness ([#2834](#2834)) ([30fe136](30fe136)) * Database SDK upgrade ([#2814](#2814)) ([750fe37](750fe37)) ### 🔧 **Misc** * accept non-pointer values in the generated builder methods ([#2816](#2816)) ([c29fbf1](c29fbf1)) * Add a script for creating labels ([#2778](#2778)) ([ce0fbad](ce0fbad)) * Adjust before 0.92.0 ([#2857](#2857)) ([0598656](0598656)) * Continue random ids rework ([#2819](#2819)) ([f20940c](f20940c)) * Random ids rework part3 ([#2833](#2833)) ([36ead85](36ead85)) * Random ids rework part4 ([#2837](#2837)) ([64518a3](64518a3)) * Update issue for table and warehouse redesign state ([#2845](#2845)) ([149e55e](149e55e)) ### 🐛 **Bug fixes:** * Fix failing integration tests ([#2832](#2832)) ([2e2ca6c](2e2ca6c)) * Fix QUOTED_IDENTIFIERS_IGNORE_CASE parameter test ([#2841](#2841)) ([92ad1d3](92ad1d3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
Setting
QUOTED_IDENTIFIERS_IGNORE_CASE
inTestAcc_Parameters_QuotedIdentifiersIgnoreCaseCanBeSet
was interfering with the tests being run on other branches. It resulted in seemingly randomDatabase 'XYZ' does not exist or not authorized
errors for database that exists, works moments before and moments after. Sequence of example statements:What was done:
TestAcc_Parameters_QuotedIdentifiersIgnoreCaseCanBeSet
creates new user and sets theQUOTED_IDENTIFIERS_IGNORE_CASE
parameter on itQUOTED_IDENTIFIERS_IGNORE_CASE
is set to true initially