Skip to content

Commit

Permalink
fix: remove cache dir before creation
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Jan 15, 2025
1 parent 40ffbf5 commit e960cbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import (
func TestGenerate(t *testing.T) {
mkTmpCache(t)

args := []string{
baseArgs := []string{
"generate",
"--verbose",
"--dry-run",
}

withGenerateConfigs(t, func(testFile string) {
args = append(args, []string{
args := append(baseArgs, []string{
"--config", testFile,
}...)
t.Logf("running generate integration with args %v", args)
Expand Down
4 changes: 3 additions & 1 deletion cmd/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ func withGenerateConfigs(t *testing.T, callback func(string)) {

// mkTmpCache makes the test-cache directory
func mkTmpCache(t *testing.T) {
if err := os.Mkdir("/tmp/test-cache", 0755); !os.IsExist(err) {
dir := "/tmp/test-cache"
_ = os.RemoveAll(dir)
if err := os.Mkdir(dir, 0755); err != nil {
assert.Nil(t, err)
}
}

0 comments on commit e960cbe

Please sign in to comment.