Skip to content

Commit

Permalink
Merge pull request #79 from appleboy/docker
Browse files Browse the repository at this point in the history
Fixed #78 docker test error.
  • Loading branch information
appleboy committed May 4, 2016
2 parents c607d25 + d3f7e70 commit a08b2da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 47 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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),)
Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile.testing
Original file line number Diff line number Diff line change
Expand Up @@ -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/status_test.go
RUN go get -v -d -t ./...
46 changes: 0 additions & 46 deletions gorush/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a08b2da

Please sign in to comment.