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

chore: use ephemeral workspaces in tests #219

Merged
merged 8 commits into from
Jul 18, 2024

Conversation

mitchnielsen
Copy link
Contributor

@mitchnielsen mitchnielsen commented Jun 18, 2024

Summary

Related to #218

To do

  • Add helpers for ephemeral workspaces
  • Implement helpers for ephemeral workspaces where workspaces are referenced -> implemented for some, let's start there before the PR gets too big and we can add more in future PR(s)

Conflicts with 'nonamedreturns' linter, and named returns isn't always
used or recommended.
Adds two helpers to create random values and random workspaces to be
used as ephemeral resources.
@mitchnielsen mitchnielsen added the maintenance Maintenance work - won't show in release notes label Jun 18, 2024
@mitchnielsen mitchnielsen self-assigned this Jun 18, 2024
@mitchnielsen mitchnielsen force-pushed the ephemeral-workspaces-in-tests branch from 58b8093 to ed98acf Compare June 18, 2024 23:21
Uses the new ephemeral workspace helpers to create the new, random
workspace.
Needed to set '10' as a constant to work around the 'mnd' linter.
@mitchnielsen
Copy link
Contributor Author

@parkedwards - I got the ball rolling here and will pick it back up after the move 👍🏼

@parkedwards
Copy link
Contributor

awesome - thank you @mitchnielsen

Comment on lines +83 to +85
func NewRandomPrefixedString() string {
return TestAccPrefix + acctest.RandStringFromCharSet(RandomStringLength, acctest.CharSetAlphaNum)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@mitchnielsen
Copy link
Contributor Author

@parkedwards - after some thinking, I wonder if it's nicer to just merge this one before it gets too big. Instead of doing it all in one big change, we can use this one to add the new helpers and implement it in a few places, and then I'll follow up with further implementation in separate PR(s). If you disagree just lmk and I'm happy to continue with making the changes here 👍🏼

Copy link
Contributor

@parkedwards parkedwards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for getting the ball rolling on this dude, i know it can be a little tedious. but this is already a much needed improvement to the test suite

@parkedwards
Copy link
Contributor

@parkedwards - after some thinking, I wonder if it's nicer to just merge this one before it gets too big. Instead of doing it all in one big change, we can use this one to add the new helpers and implement it in a few places, and then I'll follow up with further implementation in separate PR(s). If you disagree just lmk and I'm happy to continue with making the changes here 👍🏼

totally reasonable to me - we could also do something like "if you touch some code, update the tests"

@mitchnielsen
Copy link
Contributor Author

No worries at all, it's helped me get up to speed on how all of this works together 👍🏼

@mitchnielsen mitchnielsen merged commit 01c2b9a into main Jul 18, 2024
7 checks passed
@mitchnielsen mitchnielsen deleted the ephemeral-workspaces-in-tests branch July 18, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance work - won't show in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants