From e65b3f131620453976ff53d0a76e231854f57a61 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Sat, 22 Feb 2020 17:27:55 -0800 Subject: [PATCH] Fix CI for test updates Signed-off-by: Derek McGowan --- contrib/token-server/token_test.go | 8 ++++++-- notifications/http_test.go | 2 +- .../driver/middleware/cloudfront/middleware_test.go | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/contrib/token-server/token_test.go b/contrib/token-server/token_test.go index 988d0533..cd9ea30d 100644 --- a/contrib/token-server/token_test.go +++ b/contrib/token-server/token_test.go @@ -8,9 +8,10 @@ import ( "testing" "time" + "strings" + "github.com/docker/distribution/registry/auth" "github.com/docker/libtrust" - "strings" ) func TestCreateJWTSuccessWithEmptyACL(t *testing.T) { @@ -28,8 +29,11 @@ func TestCreateJWTSuccessWithEmptyACL(t *testing.T) { SigningKey: pk, } - grantedAccessList := make([]auth.Access, 0, 0) + grantedAccessList := make([]auth.Access, 0) token, err := tokenIssuer.CreateJWT("test", "test", grantedAccessList) + if err != nil { + t.Fatal(err) + } tokens := strings.Split(token, ".") diff --git a/notifications/http_test.go b/notifications/http_test.go index a5018b77..5bf5d5d6 100644 --- a/notifications/http_test.go +++ b/notifications/http_test.go @@ -10,10 +10,10 @@ import ( "net/http/httptest" "reflect" "strconv" + "strings" "testing" "github.com/docker/distribution/manifest/schema1" - "strings" ) // TestHTTPSink mocks out an http endpoint and notifies it under a couple of diff --git a/registry/storage/driver/middleware/cloudfront/middleware_test.go b/registry/storage/driver/middleware/cloudfront/middleware_test.go index a7fc83e7..cbc7bc44 100644 --- a/registry/storage/driver/middleware/cloudfront/middleware_test.go +++ b/registry/storage/driver/middleware/cloudfront/middleware_test.go @@ -1,11 +1,11 @@ package middleware import ( - "testing" - - check "gopkg.in/check.v1" "io/ioutil" "os" + "testing" + + "gopkg.in/check.v1" ) func Test(t *testing.T) { check.TestingT(t) }