testing: run test in simulated appengine environment (#2145)
This commit is contained in:
Родитель
b519e3d28d
Коммит
cd69bb2707
|
@ -11,14 +11,19 @@ matrix:
|
||||||
include:
|
include:
|
||||||
- go: 1.10.x
|
- go: 1.10.x
|
||||||
env: RUN386=1
|
env: RUN386=1
|
||||||
|
- go: 1.9.x
|
||||||
|
env: GAE=1
|
||||||
|
|
||||||
|
|
||||||
go_import_path: google.golang.org/grpc
|
go_import_path: google.golang.org/grpc
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- if [[ -n "$RUN386" ]]; then export GOARCH=386; fi
|
- if [[ -n "$RUN386" ]]; then export GOARCH=386; fi
|
||||||
- if [[ "$TRAVIS_GO_VERSION" = 1.10* && "$GOARCH" != "386" ]]; then ./vet.sh -install || exit 1; 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:
|
script:
|
||||||
- if [[ "$TRAVIS_GO_VERSION" = 1.10* && "$GOARCH" != "386" ]]; then ./vet.sh || exit 1; fi
|
- 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
|
- make test || exit 1
|
||||||
- if [[ "$GOARCH" != "386" ]]; then make testrace; fi
|
- if [[ "$GOARCH" != "386" ]]; then make testrace; fi
|
||||||
|
|
7
Makefile
7
Makefile
|
@ -9,6 +9,9 @@ updatedeps:
|
||||||
testdeps:
|
testdeps:
|
||||||
go get -d -v -t google.golang.org/grpc/...
|
go get -d -v -t google.golang.org/grpc/...
|
||||||
|
|
||||||
|
testgaedeps:
|
||||||
|
goapp get -d -v -t -tags 'appengine appenginevm' google.golang.org/grpc/...
|
||||||
|
|
||||||
updatetestdeps:
|
updatetestdeps:
|
||||||
go get -d -v -t -u -f google.golang.org/grpc/...
|
go get -d -v -t -u -f google.golang.org/grpc/...
|
||||||
|
|
||||||
|
@ -31,6 +34,9 @@ test: testdeps
|
||||||
testrace: testdeps
|
testrace: testdeps
|
||||||
go test -race -cpu 1,4 -timeout 7m google.golang.org/grpc/...
|
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:
|
clean:
|
||||||
go clean -i google.golang.org/grpc/...
|
go clean -i google.golang.org/grpc/...
|
||||||
|
|
||||||
|
@ -39,6 +45,7 @@ clean:
|
||||||
deps \
|
deps \
|
||||||
updatedeps \
|
updatedeps \
|
||||||
testdeps \
|
testdeps \
|
||||||
|
testgaedeps \
|
||||||
updatetestdeps \
|
updatetestdeps \
|
||||||
build \
|
build \
|
||||||
proto \
|
proto \
|
||||||
|
|
|
@ -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"
|
Загрузка…
Ссылка в новой задаче