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

Update domains sweeper #753

Merged

Conversation

scotchneat
Copy link
Contributor

I noticed domain resources aren't getting cleaned up after acceptance tests but it's difficult to identify which tests aren't properly cleaning up after themselves.

This change includes a few things to help diagnose as well clean up:

  1. Update the domains resource sweeper to use match resources with the common testNamePrefix (a const value set in the digitalocean/provider_test.go#L17)
  2. Update the names used for domains in tests to call randomTestName() (which uses the above common prefix)
  3. Extended randomTestName() to allow a list of strings that will get concatenated with - (and will replace spaces with _).
    • I'm curious what thoughts there are on this. I made the function variadic so existing calls don't fail. However, I know some resources have a relatively short name length limit and this could cause issues if misused.
  4. Lastly, I added a job to the acceptance test workflows to call make sweep. This will allow the resources to be cleaned up after every acceptance test run regardless of the tests handling clean up properly, and help reduce future errors due to resource limits being reached.
@scotchneat scotchneat requested a review from a team November 30, 2021 22:12
Copy link
Member

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

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

👍 Looks great!

We have a ticket in our internal backlog around standardizing resource names used in tests and adding sweepers for all resource types. It's something we haven't been consistent about.

@andrewsomething andrewsomething merged commit e53bdf7 into digitalocean:main Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants