-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Escape the display name in active folder data source (in case of spaces, etc) #1261
Conversation
Hi @ts-tek, thanks for contributing! Could you add a test to data_source_google_active_folder_test.go? |
Sure will do. |
I've added a test, but not sure how to run the acceptance tests since I don't know what creds to use. |
I went ahead and ran the tests for you:
|
Thank you, this should fix that. |
(also psst @emilymye I totally forgot about this yesterday but you should be able to run the tests in teamcity as well- just go to branches and then click the ... next to "Run" for the branch you want and change the value of TEST_PATTERN to the test pattern you want to run) |
Got caught out, one more shot now please? |
New results:
|
Frustrating, so it looks like the Google REST API is returning an unexpected result. If you create two folders that differ by a space character, say: 'Test Folder' and 'Test-Folder', you get the following results in a search request when setting displayName to the following values in the search:
I think this is a bug in the API unless I'm missing something. I think I'll need to workaround by just assuming there could be multiple results and iterating through them until finding a folder that matches the exact display name given. Will knock something up to that effect. |
OK, ready for test again. |
Looks like @paddycarver re-ran the test. Here's the output:
Also, I'd love to help you be able to run the tests on your own, if you have the right org permissions to do so. Take a look at the instructions at https://github.com/terraform-providers/terraform-provider-google/blob/master/.github/CONTRIBUTING.md#tests and let me know if you run into any issues! |
Thank you for the pointer. I've made some more changes and verified the acceptance tests work now as well. |
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.
Looks good, thanks so much @ts-tek!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Folders can have spaces in them. This change makes it so that the active_folder data source can correctly query for these.