From 0e416ea699455798ad96ac188d8122b7ae28eb43 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 20 Aug 2015 22:32:47 -0700 Subject: [PATCH] Tests were running 4 times due to multiple times the TestingT{} was being called Calling multiple times TestingT{} will hook up runner for Suites for that many times which would lead to repeated running tests. Fix it by only initializing it once for all the Suites --- pkg/server/api_donut_cache_test.go | 3 --- pkg/server/api_donut_test.go | 3 --- pkg/server/api_signature_v4_test.go | 3 --- pkg/server/rpc_test.go | 3 --- pkg/server/signature-v4_test.go | 6 ++++++ 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/pkg/server/api_donut_cache_test.go b/pkg/server/api_donut_cache_test.go index c94e4c290..472f8cfe3 100644 --- a/pkg/server/api_donut_cache_test.go +++ b/pkg/server/api_donut_cache_test.go @@ -22,7 +22,6 @@ import ( "os" "path/filepath" "strings" - "testing" "encoding/xml" "net/http" @@ -33,8 +32,6 @@ import ( "github.com/minio/minio/pkg/server/api" ) -func TestAPIDonutCache(t *testing.T) { TestingT(t) } - type MyAPIDonutCacheSuite struct { root string } diff --git a/pkg/server/api_donut_test.go b/pkg/server/api_donut_test.go index 3ef10b842..daac80386 100644 --- a/pkg/server/api_donut_test.go +++ b/pkg/server/api_donut_test.go @@ -23,7 +23,6 @@ import ( "path/filepath" "strconv" "strings" - "testing" "encoding/xml" "net/http" @@ -34,8 +33,6 @@ import ( "github.com/minio/minio/pkg/server/api" ) -func TestAPIDonut(t *testing.T) { TestingT(t) } - type MyAPIDonutSuite struct { root string } diff --git a/pkg/server/api_signature_v4_test.go b/pkg/server/api_signature_v4_test.go index f26a14a5b..2398ec28a 100644 --- a/pkg/server/api_signature_v4_test.go +++ b/pkg/server/api_signature_v4_test.go @@ -23,7 +23,6 @@ import ( "os" "path/filepath" "strings" - "testing" "encoding/xml" "net/http" @@ -35,8 +34,6 @@ import ( "github.com/minio/minio/pkg/server/api" ) -func TestAPISignatureV4(t *testing.T) { TestingT(t) } - type MyAPISignatureV4Suite struct { root string req *http.Request diff --git a/pkg/server/rpc_test.go b/pkg/server/rpc_test.go index 47d807dfb..1eefd142b 100644 --- a/pkg/server/rpc_test.go +++ b/pkg/server/rpc_test.go @@ -19,7 +19,6 @@ package server import ( "net/http" "net/http/httptest" - "testing" jsonrpc "github.com/minio/minio/internal/github.com/gorilla/rpc/v2/json" . "github.com/minio/minio/internal/gopkg.in/check.v1" @@ -27,8 +26,6 @@ import ( "github.com/minio/minio/pkg/server/rpc" ) -func TestRPC(t *testing.T) { TestingT(t) } - type MyRPCSuite struct{} var _ = Suite(&MyRPCSuite{}) diff --git a/pkg/server/signature-v4_test.go b/pkg/server/signature-v4_test.go index d2cee4511..d7c850e8f 100644 --- a/pkg/server/signature-v4_test.go +++ b/pkg/server/signature-v4_test.go @@ -28,10 +28,16 @@ import ( "regexp" "sort" "strings" + "testing" "time" "unicode/utf8" + + . "github.com/minio/minio/internal/gopkg.in/check.v1" ) +// Hook up gocheck into the "go test" runner. +func Test(t *testing.T) { TestingT(t) } + const ( authHeader = "AWS4-HMAC-SHA256" iso8601Format = "20060102T150405Z"