Skip to content

fix: Set cache dir for coderd tests #3160

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

Merged
merged 2 commits into from
Jul 25, 2022
Merged

Conversation

mafredri
Copy link
Member

This PR partially amends the issue in #3159.

There are still 3 instances of terraform being left in /tmp.

  • fix: Set cache dir for coderd in codedtest
  • fix: Ensure server cli tests have a cache path

@mafredri mafredri self-assigned this Jul 25, 2022
@mafredri mafredri requested a review from a team July 25, 2022 10:37
Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

Would it be crazy to just add --cache-dir t.TempDir() to clitest.New()?

We already add a global config dir, we could just add the cache dir in the test helper?

cmd.SetArgs(append([]string{"--global-config", dir}, args...))

@mafredri
Copy link
Member Author

Would it be crazy to just add --cache-dir t.TempDir() to clitest.New()?

I thought about it, we'd need to detect that we're running the server command and that --cache-dir isn't set, though. That's also doable. Only edge case left is if the test wants to test setting it via environment.

@mafredri mafredri merged commit 1c04b20 into main Jul 25, 2022
@mafredri mafredri deleted the mafredri/coderdtest-cache-dir branch July 25, 2022 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants