fixed #78 docker test error.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-05-03 20:39:24 +08:00
parent c607d25a10
commit 0a673bde48
3 changed files with 5 additions and 47 deletions

View File

@ -34,7 +34,9 @@ docker_build: clean
docker_test: docker_test:
@docker build --rm -t $(TEST_IMAGE) -f docker/Dockerfile.testing . @docker build --rm -t $(TEST_IMAGE) -f docker/Dockerfile.testing .
@docker run --rm -e ANDROID_TEST_TOKEN=$(ANDROID_TEST_TOKEN) -e ANDROID_API_KEY=$(ANDROID_API_KEY) $(TEST_IMAGE) sh -c "cd gorush && go test -v" @docker run --name gorush-redis -d redis
@docker run --rm --link gorush-redis:redis -e ANDROID_TEST_TOKEN=$(ANDROID_TEST_TOKEN) -e ANDROID_API_KEY=$(ANDROID_API_KEY) $(TEST_IMAGE) sh -c "cd gorush && go test -v"
@docker rm -f gorush-redis
deploy: deploy:
ifeq ($(tag),) ifeq ($(tag),)

View File

@ -5,4 +5,6 @@ MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
RUN mkdir -p /tmp/build RUN mkdir -p /tmp/build
Add . /tmp/build/ Add . /tmp/build/
WORKDIR /tmp/build WORKDIR /tmp/build
RUN sed -i"" -e "s/localhost/redis/g" config/config.yml
RUN sed -i"" -e "s/localhost/redis/g" gorush/*.go
RUN go get -v -d -t ./... RUN go get -v -d -t ./...

View File

@ -2,55 +2,9 @@ package gorush
import ( import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
// "sync/atomic"
"testing" "testing"
) )
// func TestAddTotalCount(t *testing.T) {
// InitAppStatus()
// addTotalCount(1000)
// val := atomic.LoadInt64(&RushStatus.TotalCount)
// assert.Equal(t, int64(1000), val)
// }
// func TestAddIosSuccess(t *testing.T) {
// InitAppStatus()
// addIosSuccess(1000)
// val := atomic.LoadInt64(&RushStatus.Ios.PushSuccess)
// assert.Equal(t, int64(1000), val)
// }
// func TestAddIosError(t *testing.T) {
// InitAppStatus()
// addIosError(1000)
// val := atomic.LoadInt64(&RushStatus.Ios.PushError)
// assert.Equal(t, int64(1000), val)
// }
// func TestAndroidSuccess(t *testing.T) {
// InitAppStatus()
// addAndroidSuccess(1000)
// val := atomic.LoadInt64(&RushStatus.Android.PushSuccess)
// assert.Equal(t, int64(1000), val)
// }
// func TestAddAndroidError(t *testing.T) {
// InitAppStatus()
// addAndroidError(1000)
// val := atomic.LoadInt64(&RushStatus.Android.PushError)
// assert.Equal(t, int64(1000), val)
// }
func TestStatForMemoryEngine(t *testing.T) { func TestStatForMemoryEngine(t *testing.T) {
var val int64 var val int64
PushConf.Stat.Engine = "memory" PushConf.Stat.Engine = "memory"