diff --git a/tools/run_tests/build_node.sh b/tools/run_tests/build_node.sh index 600b1bde8cd..4b092982b29 100755 --- a/tools/run_tests/build_node.sh +++ b/tools/run_tests/build_node.sh @@ -2,19 +2,18 @@ set -ex +CONFIG=${CONFIG:-opt} + # change to grpc repo root cd $(dirname $0)/../.. # tells npm install to look for files in that directory export GRPC_ROOT=`pwd` # tells npm install the subdirectory with library files -export GRPC_LIB_SUBDIR=libs/opt +export GRPC_LIB_SUBDIR=libs/$CONFIG # tells npm install not to use default locations export GRPC_NO_INSTALL=yes -# build the c libraries -make -j static_c - cd src/node npm install diff --git a/tools/run_tests/build_php.sh b/tools/run_tests/build_php.sh index 6841656bdb8..0a8d0c74923 100755 --- a/tools/run_tests/build_php.sh +++ b/tools/run_tests/build_php.sh @@ -2,14 +2,13 @@ set -ex +CONFIG=${CONFIG:-opt} + # change to grpc repo root cd $(dirname $0)/../.. root=`pwd` -export GRPC_LIB_SUBDIR=libs/opt - -# make the libraries -make -j static_c +export GRPC_LIB_SUBDIR=libs/$CONFIG # build php cd src/php @@ -18,4 +17,3 @@ cd ext/grpc phpize ./configure --enable-grpc=$root make - diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh new file mode 100755 index 00000000000..00562959490 --- /dev/null +++ b/tools/run_tests/run_node.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -ex + +# change to grpc repo root +cd $(dirname $0)/../.. + +root=`pwd` + +$root/src/node/node_modules/mocha/bin/mocha $root/src/node/test diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index da849f04cb0..b7248e524b4 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -46,8 +46,8 @@ class CLanguage(object): self.make_target = make_target with open('tools/run_tests/tests.json') as f: js = json.load(f) - self.binaries = [tgt['name'] - for tgt in js + self.binaries = [tgt['name'] + for tgt in js if tgt['language'] == test_lang] def test_binaries(self, config): @@ -59,6 +59,19 @@ class CLanguage(object): def build_steps(self): return [] +class NodeLanguage(object): + + def __init__(self): + self.allow_hashing = False + + def test_binaries(self, config): + return ['tools/run_tests/run_node.sh'] + + def make_targets(self): + return ['static_c'] + + def build_steps(self): + return [['tools/run_tests/build_node.sh']] class PhpLanguage(object): @@ -69,7 +82,7 @@ class PhpLanguage(object): return ['src/php/bin/run_tests.sh'] def make_targets(self): - return [] + return ['static_c'] def build_steps(self): return [['tools/run_tests/build_php.sh']] @@ -107,6 +120,7 @@ _DEFAULT = ['dbg', 'opt'] _LANGUAGES = { 'c++': CLanguage('cxx', 'c++'), 'c': CLanguage('c', 'c'), + 'node': NodeLanguage(), 'php': PhpLanguage(), 'python': PythonLanguage(), } @@ -190,8 +204,8 @@ class TestCache(object): def _build_and_run(check_cancelled, newline_on_success, cache): """Do one pass of building & running tests.""" - # build latest, sharing cpu between the various makes - if not jobset.run(build_steps): + # build latest sequentially + if not jobset.run(build_steps, maxjobs=1): return 1 # run all the tests