testing: run test in simulated appengine environment (#2145)
This commit is contained in:
@ -11,14 +11,19 @@ matrix:
|
||||
include:
|
||||
- go: 1.10.x
|
||||
env: RUN386=1
|
||||
- go: 1.9.x
|
||||
env: GAE=1
|
||||
|
||||
|
||||
go_import_path: google.golang.org/grpc
|
||||
|
||||
before_install:
|
||||
- if [[ -n "$RUN386" ]]; then export GOARCH=386; fi
|
||||
- if [[ "$TRAVIS_GO_VERSION" = 1.10* && "$GOARCH" != "386" ]]; then ./vet.sh -install || exit 1; fi
|
||||
- if [[ "$GAE" = 1 ]]; then source ./install_gae.sh || exit 1; fi
|
||||
|
||||
script:
|
||||
- if [[ "$TRAVIS_GO_VERSION" = 1.10* && "$GOARCH" != "386" ]]; then ./vet.sh || exit 1; fi
|
||||
- if [[ "$GAE" = 1 ]]; then make testappengine || exit 1; exit 0; fi
|
||||
- make test || exit 1
|
||||
- if [[ "$GOARCH" != "386" ]]; then make testrace; fi
|
||||
|
7
Makefile
7
Makefile
@ -9,6 +9,9 @@ updatedeps:
|
||||
testdeps:
|
||||
go get -d -v -t google.golang.org/grpc/...
|
||||
|
||||
testgaedeps:
|
||||
goapp get -d -v -t -tags 'appengine appenginevm' google.golang.org/grpc/...
|
||||
|
||||
updatetestdeps:
|
||||
go get -d -v -t -u -f google.golang.org/grpc/...
|
||||
|
||||
@ -31,6 +34,9 @@ test: testdeps
|
||||
testrace: testdeps
|
||||
go test -race -cpu 1,4 -timeout 7m google.golang.org/grpc/...
|
||||
|
||||
testappengine: testgaedeps
|
||||
goapp test -cpu 1,4 -timeout 5m google.golang.org/grpc/...
|
||||
|
||||
clean:
|
||||
go clean -i google.golang.org/grpc/...
|
||||
|
||||
@ -39,6 +45,7 @@ clean:
|
||||
deps \
|
||||
updatedeps \
|
||||
testdeps \
|
||||
testgaedeps \
|
||||
updatetestdeps \
|
||||
build \
|
||||
proto \
|
||||
|
6
install_gae.sh
Executable file
6
install_gae.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
TMP=$(mktemp -d /tmp/sdk.XXX) \
|
||||
&& curl -o $TMP.zip "https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.64.zip" \
|
||||
&& unzip -q $TMP.zip -d $TMP \
|
||||
&& export PATH="$PATH:$TMP/go_appengine"
|
Reference in New Issue
Block a user