gorealis v2 refactor (#5)

* Changing default timeout for start maintenance.

* Upgrading dependencies to gorealis v2 and thrift  0.12.0

* Refactored to update to gorealis v2.
This commit is contained in:
Renan DelValle 2018-12-27 11:31:51 -08:00 committed by GitHub
parent ad4dd9606e
commit 6ab5c9334d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1335 changed files with 137431 additions and 61530 deletions

View file

@ -24,7 +24,6 @@ fi
DIR="$( cd "$( dirname "$0" )" && pwd )"
ISTANBUL="$DIR/../../../node_modules/istanbul/lib/cli.js"
RUNBROWSER="$DIR/../../../node_modules/run-browser/bin/cli.js"
REPORT_PREFIX="${DIR}/../coverage/report"
@ -34,37 +33,27 @@ export NODE_PATH="${DIR}:${DIR}/../lib:${NODE_PATH}"
testServer()
{
echo " Testing $1 Client/Server with protocol $2 and transport $3 $4";
echo " [ECMA $1] Testing $2 Client/Server with protocol $3 and transport $4 $5";
RET=0
if [ -n "${COVER}" ]; then
${ISTANBUL} cover ${DIR}/server.js --dir ${REPORT_PREFIX}${COUNT} --handle-sigint -- --type $1 -p $2 -t $3 $4 &
${ISTANBUL} cover ${DIR}/server.js --dir ${REPORT_PREFIX}${COUNT} --handle-sigint -- --type $2 -p $3 -t $4 $5 &
COUNT=$((COUNT+1))
else
node ${DIR}/server.js --type $1 -p $2 -t $3 $4 &
node ${DIR}/server.js --${1} --type $2 -p $3 -t $4 $5 &
fi
SERVERPID=$!
sleep 1
sleep 0.1
if [ -n "${COVER}" ]; then
${ISTANBUL} cover ${DIR}/client.js --dir ${REPORT_PREFIX}${COUNT} -- --type $1 -p $2 -t $3 $4 || RET=1
${ISTANBUL} cover ${DIR}/client.js --dir ${REPORT_PREFIX}${COUNT} -- --${1} --type $2 -p $3 -t $4 $5 || RET=1
COUNT=$((COUNT+1))
else
node ${DIR}/client.js --type $1 -p $2 -t $3 $4 || RET=1
node ${DIR}/client.js --${1} --type $2 -p $3 -t $4 $5 || RET=1
fi
kill -2 $SERVERPID || RET=1
wait $SERVERPID
return $RET
}
testBrowser()
{
echo " Testing browser client with http server with json protocol and buffered transport";
RET=0
node ${DIR}/server.js --type http -p json -t buffered &
SERVERPID=$!
sleep 1
${RUNBROWSER} ${DIR}/browser_client.js --phantom || RET=1
kill -2 $SERVERPID || RET=1
return $RET
}
TESTOK=0
@ -72,6 +61,9 @@ TESTOK=0
${DIR}/../../../compiler/cpp/thrift -o ${DIR} --gen js:node ${DIR}/../../../test/ThriftTest.thrift
${DIR}/../../../compiler/cpp/thrift -o ${DIR} --gen js:node ${DIR}/../../../test/JsDeepConstructorTest.thrift
mkdir ${DIR}/gen-nodejs-es6
${DIR}/../../../compiler/cpp/thrift -out ${DIR}/gen-nodejs-es6 --gen js:node,es6 ${DIR}/../../../test/ThriftTest.thrift
${DIR}/../../../compiler/cpp/thrift -out ${DIR}/gen-nodejs-es6 --gen js:node,es6 ${DIR}/../../../test/JsDeepConstructorTest.thrift
#unit tests
@ -82,21 +74,20 @@ node ${DIR}/deep-constructor.test.js || TESTOK=1
for type in tcp multiplex websocket http
do
for protocol in compact binary json
do
for transport in buffered framed
do
testServer $type $protocol $transport || TESTOK=1
testServer $type $protocol $transport --ssl || TESTOK=1
testServer $type $protocol $transport --promise || TESTOK=1
for ecma_version in es5 es6
do
testServer $ecma_version $type $protocol $transport || TESTOK=1
testServer $ecma_version $type $protocol $transport --ssl || TESTOK=1
testServer $ecma_version $type $protocol $transport --callback || TESTOK=1
done
done
done
done
# XHR only until phantomjs 2 is released.
testBrowser
if [ -n "${COVER}" ]; then
${ISTANBUL} report --dir "${DIR}/../coverage" --include "${DIR}/../coverage/report*/coverage.json" lcov cobertura html