Skip to content

Commit

Permalink
Merge pull request #10806 from prezha/fix-testlogfile
Browse files Browse the repository at this point in the history
make sure path to logs directory exists
  • Loading branch information
medyagh authored Mar 23, 2021
2 parents 141a7da + badcfe2 commit ebb13e5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/minikube/audit/logFile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@ import (
"io"
"io/ioutil"
"os"
"path/filepath"
"testing"
"time"

"k8s.io/minikube/pkg/minikube/localpath"
)

func TestLogFile(t *testing.T) {
t.Run("SetLogFile", func(t *testing.T) {
// make sure logs directory exists
if err := os.MkdirAll(filepath.Dir(localpath.AuditLog()), 0755); err != nil {
t.Fatalf("Error creating logs directory: %v", err)
}
if err := setLogFile(); err != nil {
t.Error(err)
}
Expand Down

0 comments on commit ebb13e5

Please sign in to comment.