From 865f55438d830df27e6dddade1fd286fd1428074 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 3 May 2016 09:42:53 +0800 Subject: [PATCH] add all test task. Signed-off-by: Bo-Yi Wu --- Makefile | 11 ++++++++++- gorush/global.go | 3 --- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 63bddf8..5c541cb 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,18 @@ all: build build: clean sh script/build.sh -test: +test: memory_test redis_test boltdb_test cd gorush && go test -cover -v -coverprofile=coverage.out +memory_test: + cd gorush/storage/memory && go test -v -cover *.go + +redis_test: + cd gorush/storage/redis && go test -v -cover *.go + +boltdb_test: + cd gorush/storage/boltdb && go test -v -cover *.go + html: test cd gorush && go tool cover -html=coverage.out diff --git a/gorush/global.go b/gorush/global.go index fbccf27..23d14c9 100644 --- a/gorush/global.go +++ b/gorush/global.go @@ -5,7 +5,6 @@ import ( "github.com/Sirupsen/logrus" "github.com/appleboy/gorush/gorush/config" apns "github.com/sideshow/apns2" - "gopkg.in/redis.v3" ) var ( @@ -21,8 +20,6 @@ var ( LogAccess *logrus.Logger // LogError is log server error log LogError *logrus.Logger - // RedisClient is global variable for redis - RedisClient *redis.Client // StatStorage implements the storage interface StatStorage Storage )