-
Notifications
You must be signed in to change notification settings - Fork 4
/
local_api_check.sh
executable file
·54 lines (45 loc) · 2.08 KB
/
local_api_check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
#PROTOPATH="/Users/davidraleigh/go/src/github.com/geo-grpc/api/proto"
#echo $2
##https://stackoverflow.com/a/195972/445372
echo $1/geometry-service-java/src/main/proto/epl/protobuf/ \
$1/geometry-client-cpp/proto/epl/protobuf/ \
$1/geometry-client-python/proto/epl/protobuf/ | xargs -n 1 cp $GOPATH/src/github.com/geo-grpc/api/proto/epl/protobuf/geometry.proto
echo $1/geometry-service-java/src/main/proto/epl/protobuf/ \
$1/geometry-client-cpp/proto/epl/protobuf/ \
$1/geometry-client-python/proto/epl/protobuf/ | xargs -n 1 cp $GOPATH/src/github.com/geo-grpc/api/proto/epl/protobuf/geometry_service.proto
./gradlew clean
./gradlew build install
#docker rm -f temp-cc
#docker build -t echoparklabs/geometry-service-java:11-jdk-slim .
#docker run -d --name=temp-cc echoparklabs/geometry-service-java:11-jdk-slim
echo test C++
echo $1
rm -rf $1/geometry-client-cpp/build
mkdir $1/geometry-client-cpp/build
set -e
cmake -B $1/geometry-client-cpp/build $1/geometry-client-cpp/build/..
make -C $1/geometry-client-cpp/build
$1/geometry-client-cpp/build/geometry-test/unitTest
echo end test C++
echo build Go
protoc -I ${PROTOPATH} \
${PROTOPATH}/epl/protobuf/geometry.proto \
--go_out=$GOPATH/src
protoc -I ${PROTOPATH} \
${PROTOPATH}/epl/grpc/geometry_operators.proto \
--go_out=plugins=grpc:$GOPATH/src
echo test Go
cd ${GOPATH}/src/github.com/geo-grpc/geometry-client-go
export GO111MODULE=on
go test ${GOPATH}/src/github.com/geo-grpc/geometry-client-go/test/geometry_test.go -v
echo end test Go
echo build Python
python3 -mgrpc_tools.protoc -I=$1/geometry-client-python/proto/ --python_out=$1/geometry-client-python/ $1/geometry-client-python/proto/epl/protobuf/geometry.proto
python3 -mgrpc_tools.protoc -I=$1/geometry-client-python/proto/ --python_out=$1/geometry-client-python/ --grpc_python_out=$1/geometry-client-python/ $1/geometry-client-python/proto/epl/grpc/geometry_operators.proto
echo test Python
source "$1/geometry-client-python/venv/bin/activate"
pytest $1/geometry-client-python/test/test_client.py
deactivate
echo end test Python
docker rm -f temp-cc