travis: add e2e tests with redis storage
This commit is contained in:
parent
0a420fe053
commit
ddeb44b527
1 changed files with 51 additions and 1 deletions
50
.travis.yml
50
.travis.yml
|
@ -2,12 +2,15 @@ language: go
|
||||||
go:
|
go:
|
||||||
- 1.13.x
|
- 1.13.x
|
||||||
sudo: false
|
sudo: false
|
||||||
|
services:
|
||||||
|
- redis-server
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
# Using vendored dependencies
|
# Using vendored dependencies
|
||||||
- install:
|
- install:
|
||||||
- go get -u golang.org/x/lint/golint
|
- go get -u golang.org/x/lint/golint
|
||||||
- go get -u golang.org/x/tools/cmd/...
|
- go get -u golang.org/x/tools/cmd/...
|
||||||
|
- go get gopkg.in/mikefarah/yq.v2
|
||||||
script:
|
script:
|
||||||
- go mod download
|
- go mod download
|
||||||
- go test -v -race $(go list ./...)
|
- go test -v -race $(go list ./...)
|
||||||
|
@ -15,26 +18,57 @@ matrix:
|
||||||
- diff <(goimports -local github.com/chihaya/chihaya -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "")
|
- diff <(goimports -local github.com/chihaya/chihaya -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "")
|
||||||
- (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done)
|
- (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done)
|
||||||
- go install github.com/chihaya/chihaya/cmd/chihaya
|
- go install github.com/chihaya/chihaya/cmd/chihaya
|
||||||
|
# Run e2e test with example config.
|
||||||
- chihaya --config=example_config.yaml --debug&
|
- chihaya --config=example_config.yaml --debug&
|
||||||
- pid=$!
|
- pid=$!
|
||||||
- sleep 2 # wait for chihaya to start up (gross)
|
- sleep 2 # wait for chihaya to start up (gross)
|
||||||
- chihaya e2e --debug
|
- chihaya e2e --debug
|
||||||
- kill $pid
|
- kill $pid
|
||||||
|
# Run e2e test with redis.
|
||||||
|
- |
|
||||||
|
cat << EOF | yq.v2 w -s - example_config.yaml | yq.v2 d - chihaya.storage.config.shard_count >> redis_config.yaml
|
||||||
|
chihaya.storage.name: redis
|
||||||
|
chihaya.storage.config.redis_broker: "redis://localhost:6379/0"
|
||||||
|
chihaya.storage.config.redis_read_timeout: 15s
|
||||||
|
chihaya.storage.config.redis_write_timeout: 15s
|
||||||
|
chihaya.storage.config.redis_connect_timeout: 15s
|
||||||
|
EOF
|
||||||
|
- chihaya --config=redis_config.yaml --debug&
|
||||||
|
- pid=$!
|
||||||
|
- sleep 2 # wait for chihaya to start up (gross)
|
||||||
|
- chihaya e2e --debug
|
||||||
|
- kill $pid
|
||||||
# Using HEAD of dependencies
|
# Using HEAD of dependencies
|
||||||
- install:
|
- install:
|
||||||
- go get -t -u ./...
|
- go get -t -u ./...
|
||||||
- go get -u golang.org/x/lint/golint
|
- go get -u golang.org/x/lint/golint
|
||||||
- go get -u golang.org/x/tools/cmd/...
|
- go get -u golang.org/x/tools/cmd/...
|
||||||
|
- go get gopkg.in/mikefarah/yq.v2
|
||||||
script:
|
script:
|
||||||
- go test -v -race $(go list ./...)
|
- go test -v -race $(go list ./...)
|
||||||
- go vet $(go list ./...)
|
- go vet $(go list ./...)
|
||||||
- diff <(goimports -local github.com/chihaya/chihaya -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "")
|
- diff <(goimports -local github.com/chihaya/chihaya -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "")
|
||||||
- (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done)
|
- (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done)
|
||||||
- go install github.com/chihaya/chihaya/cmd/chihaya
|
- go install github.com/chihaya/chihaya/cmd/chihaya
|
||||||
|
# Run e2e test with example config.
|
||||||
- chihaya --config=example_config.yaml --debug&
|
- chihaya --config=example_config.yaml --debug&
|
||||||
- pid=$!
|
- pid=$!
|
||||||
- sleep 2 # wait for chihaya to start up (gross)
|
- sleep 2 # wait for chihaya to start up (gross)
|
||||||
- chihaya e2e --debug
|
- chihaya e2e --debug
|
||||||
|
- kill $pid
|
||||||
|
# Run e2e test with redis.
|
||||||
|
- |
|
||||||
|
cat << EOF | yq.v2 w -s - example_config.yaml | yq.v2 d - chihaya.storage.config.shard_count >> redis_config.yaml
|
||||||
|
chihaya.storage.name: redis
|
||||||
|
chihaya.storage.config.redis_broker: "redis://localhost:6379/0"
|
||||||
|
chihaya.storage.config.redis_read_timeout: 15s
|
||||||
|
chihaya.storage.config.redis_write_timeout: 15s
|
||||||
|
chihaya.storage.config.redis_connect_timeout: 15s
|
||||||
|
EOF
|
||||||
|
- chihaya --config=redis_config.yaml --debug&
|
||||||
|
- pid=$!
|
||||||
|
- sleep 2 # wait for chihaya to start up (gross)
|
||||||
|
- chihaya e2e --debug
|
||||||
- kill $pid
|
- kill $pid
|
||||||
allow_failures:
|
allow_failures:
|
||||||
# Using HEAD of dependencies
|
# Using HEAD of dependencies
|
||||||
|
@ -42,17 +76,33 @@ matrix:
|
||||||
- go get -t -u ./...
|
- go get -t -u ./...
|
||||||
- go get -u golang.org/x/lint/golint
|
- go get -u golang.org/x/lint/golint
|
||||||
- go get -u golang.org/x/tools/cmd/...
|
- go get -u golang.org/x/tools/cmd/...
|
||||||
|
- go get gopkg.in/mikefarah/yq.v2
|
||||||
script:
|
script:
|
||||||
- go test -v -race $(go list ./...)
|
- go test -v -race $(go list ./...)
|
||||||
- go vet $(go list ./...)
|
- go vet $(go list ./...)
|
||||||
- diff <(goimports -local github.com/chihaya/chihaya -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "")
|
- diff <(goimports -local github.com/chihaya/chihaya -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "")
|
||||||
- (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done)
|
- (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done)
|
||||||
- go install github.com/chihaya/chihaya/cmd/chihaya
|
- go install github.com/chihaya/chihaya/cmd/chihaya
|
||||||
|
# Run e2e test with example config.
|
||||||
- chihaya --config=example_config.yaml --debug&
|
- chihaya --config=example_config.yaml --debug&
|
||||||
- pid=$!
|
- pid=$!
|
||||||
- sleep 2 # wait for chihaya to start up (gross)
|
- sleep 2 # wait for chihaya to start up (gross)
|
||||||
- chihaya e2e --debug
|
- chihaya e2e --debug
|
||||||
- kill $pid
|
- kill $pid
|
||||||
|
# Run e2e test with redis.
|
||||||
|
- |
|
||||||
|
cat << EOF | yq.v2 w -s - example_config.yaml | yq.v2 d - chihaya.storage.config.shard_count >> redis_config.yaml
|
||||||
|
chihaya.storage.name: redis
|
||||||
|
chihaya.storage.config.redis_broker: "redis://localhost:6379/0"
|
||||||
|
chihaya.storage.config.redis_read_timeout: 15s
|
||||||
|
chihaya.storage.config.redis_write_timeout: 15s
|
||||||
|
chihaya.storage.config.redis_connect_timeout: 15s
|
||||||
|
EOF
|
||||||
|
- chihaya --config=redis_config.yaml --debug&
|
||||||
|
- pid=$!
|
||||||
|
- sleep 2 # wait for chihaya to start up (gross)
|
||||||
|
- chihaya e2e --debug
|
||||||
|
- kill $pid
|
||||||
notifications:
|
notifications:
|
||||||
irc:
|
irc:
|
||||||
channels:
|
channels:
|
||||||
|
|
Loading…
Reference in a new issue