From 87308fd97fc63bbcc2b5fe64a9f56f5016f19e77 Mon Sep 17 00:00:00 2001 From: bergquist Date: Fri, 15 Sep 2017 15:46:41 +0200 Subject: [PATCH] fixes broken tests :boom: --- pkg/components/imguploader/gcsuploader_test.go | 3 ++- pkg/components/imguploader/s3uploader_test.go | 3 ++- pkg/components/imguploader/webdavuploader_test.go | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/components/imguploader/gcsuploader_test.go b/pkg/components/imguploader/gcsuploader_test.go index 3ebfeb75275..bdc21084dbf 100644 --- a/pkg/components/imguploader/gcsuploader_test.go +++ b/pkg/components/imguploader/gcsuploader_test.go @@ -1,6 +1,7 @@ package imguploader import ( + "context" "testing" "github.com/grafana/grafana/pkg/setting" @@ -15,7 +16,7 @@ func TestUploadToGCS(t *testing.T) { gcsUploader, _ := NewImageUploader() - path, err := gcsUploader.Upload("../../../public/img/logo_transparent_400x.png") + path, err := gcsUploader.Upload(context.Background(), "../../../public/img/logo_transparent_400x.png") So(err, ShouldBeNil) So(path, ShouldNotEqual, "") diff --git a/pkg/components/imguploader/s3uploader_test.go b/pkg/components/imguploader/s3uploader_test.go index f75ad05af64..b02d4676b5e 100644 --- a/pkg/components/imguploader/s3uploader_test.go +++ b/pkg/components/imguploader/s3uploader_test.go @@ -1,6 +1,7 @@ package imguploader import ( + "context" "testing" "github.com/grafana/grafana/pkg/setting" @@ -15,7 +16,7 @@ func TestUploadToS3(t *testing.T) { s3Uploader, _ := NewImageUploader() - path, err := s3Uploader.Upload("../../../public/img/logo_transparent_400x.png") + path, err := s3Uploader.Upload(context.Background(), "../../../public/img/logo_transparent_400x.png") So(err, ShouldBeNil) So(path, ShouldNotEqual, "") diff --git a/pkg/components/imguploader/webdavuploader_test.go b/pkg/components/imguploader/webdavuploader_test.go index e88e28bd712..5a8abd0542d 100644 --- a/pkg/components/imguploader/webdavuploader_test.go +++ b/pkg/components/imguploader/webdavuploader_test.go @@ -1,6 +1,7 @@ package imguploader import ( + "context" "testing" . "github.com/smartystreets/goconvey/convey" @@ -11,7 +12,7 @@ func TestUploadToWebdav(t *testing.T) { // Can be tested with this docker container: https://hub.docker.com/r/morrisjobke/webdav/ SkipConvey("[Integration test] for external_image_store.webdav", t, func() { webdavUploader, _ := NewWebdavImageUploader("http://localhost:8888/webdav/", "test", "test", "") - path, err := webdavUploader.Upload("../../../public/img/logo_transparent_400x.png") + path, err := webdavUploader.Upload(context.Background(), "../../../public/img/logo_transparent_400x.png") So(err, ShouldBeNil) So(path, ShouldStartWith, "http://localhost:8888/webdav/") @@ -19,7 +20,7 @@ func TestUploadToWebdav(t *testing.T) { SkipConvey("[Integration test] for external_image_store.webdav with public url", t, func() { webdavUploader, _ := NewWebdavImageUploader("http://localhost:8888/webdav/", "test", "test", "http://publicurl:8888/webdav") - path, err := webdavUploader.Upload("../../../public/img/logo_transparent_400x.png") + path, err := webdavUploader.Upload(context.Background(), "../../../public/img/logo_transparent_400x.png") So(err, ShouldBeNil) So(path, ShouldStartWith, "http://publicurl:8888/webdav/")