Index: third_party/grpc/tools/run_tests/run_node.sh |
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py b/third_party/grpc/tools/run_tests/run_node.sh |
old mode 100644 |
new mode 100755 |
similarity index 57% |
copy from third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py |
copy to third_party/grpc/tools/run_tests/run_node.sh |
index 1b02d66267e294ce83977dac64f075981705647c..b94dc3ec628e270154be246b480dc2ae8d94f166 |
--- a/third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py |
+++ b/third_party/grpc/tools/run_tests/run_node.sh |
@@ -1,4 +1,5 @@ |
-# Copyright 2011, Google Inc. |
+#!/bin/bash |
+# Copyright 2015-2016, Google Inc. |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
@@ -27,27 +28,37 @@ |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+NODE_VERSION=$1 |
+source ~/.nvm/nvm.sh |
-import logging |
-_GOODBYE_MESSAGE = u'Goodbye' |
+nvm use $NODE_VERSION |
+set -ex |
+CONFIG=${CONFIG:-opt} |
-def web_socket_do_extra_handshake(request): |
- pass # Always accept. |
+# change to grpc repo root |
+cd $(dirname $0)/../.. |
+root=`pwd` |
-def web_socket_transfer_data(request): |
- while True: |
- line = request.ws_stream.receive_message() |
- if line is None: |
- return |
- if isinstance(line, unicode): |
- request.ws_stream.send_message(line, binary=False) |
- if line == _GOODBYE_MESSAGE: |
- return |
- else: |
- request.ws_stream.send_message(line, binary=True) |
+test_directory='src/node/test' |
+timeout=8000 |
- |
-def web_socket_passive_closing_handshake(request): |
- return request.ws_close_code, request.ws_close_reason |
+if [ "$CONFIG" = "gcov" ] |
+then |
+ ./node_modules/.bin/istanbul cover --dir reports/node_coverage \ |
+ -x **/interop/* ./node_modules/.bin/_mocha -- --timeout $timeout $test_directory |
+ cd build |
+ gcov Release/obj.target/grpc/ext/*.o |
+ lcov --base-directory . --directory . -c -o coverage.info |
+ lcov -e coverage.info '**/src/node/ext/*' -o coverage.info |
+ genhtml -o ../reports/node_ext_coverage --num-spaces 2 \ |
+ -t 'Node gRPC test coverage' coverage.info --rc genhtml_hi_limit=95 \ |
+ --rc genhtml_med_limit=80 --no-prefix |
+ echo '<html><head><meta http-equiv="refresh" content="0;URL=lcov-report/index.html"></head></html>' > \ |
+ ../reports/node_coverage/index.html |
+else |
+ JUNIT_REPORT_PATH=src/node/report.xml JUNIT_REPORT_STACK=1 \ |
+ ./node_modules/.bin/mocha --timeout $timeout \ |
+ --reporter mocha-jenkins-reporter $test_directory |
+fi |