fixed #78 docker test error.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
c607d25a10
commit
0a673bde48
4
Makefile
4
Makefile
|
@ -34,7 +34,9 @@ docker_build: clean
|
|||
|
||||
docker_test:
|
||||
@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:
|
||||
ifeq ($(tag),)
|
||||
|
|
|
@ -5,4 +5,6 @@ MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
|
|||
RUN mkdir -p /tmp/build
|
||||
Add . /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 ./...
|
||||
|
|
|
@ -2,55 +2,9 @@ package gorush
|
|||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
// "sync/atomic"
|
||||
"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) {
|
||||
var val int64
|
||||
PushConf.Stat.Engine = "memory"
|
||||
|
|
Loading…
Reference in New Issue