Skip to content

Commit

Permalink
Fix eventhub tests
Browse files Browse the repository at this point in the history
- set umask value explicitly for MkdirAll
- pass a file to UploadFileToBlockBob instead of a dir
  • Loading branch information
ahmelsayed committed Jul 12, 2019
1 parent 731f576 commit 906bd1d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/scalers/azure_eventhub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,22 @@ func CreateNewCheckpointInStorage(storageAccountName string, credential *azblob.
}

// Create directory checkpoints will be in
err = os.MkdirAll(urlPath, os.ModeDir)
err = os.MkdirAll(urlPath, 0777)
if err != nil {
return ctx, fmt.Errorf("Unable to create directory: %s", err)
}
defer os.RemoveAll(urlPath)

folder, err := os.Open(urlPath)
file, err := os.Create(fmt.Sprintf("%s/file", urlPath))
if err != nil {
return ctx, fmt.Errorf("Unable to create folder: %s", err)
}
defer folder.Close()
defer file.Close()

blobFolderURL := containerURL.NewBlockBlobURL(urlPath)

// Upload folder
_, err = azblob.UploadFileToBlockBlob(ctx, folder, blobFolderURL, azblob.UploadToBlockBlobOptions{
// Upload file
_, err = azblob.UploadFileToBlockBlob(ctx, file, blobFolderURL, azblob.UploadToBlockBlobOptions{
BlockSize: 4 * 1024 * 1024,
Parallelism: 16})
if err != nil {
Expand Down

0 comments on commit 906bd1d

Please sign in to comment.