Merge pull request #213 from murgatroid99/node_run_tests_py

Add Node tests to run_tests.py and fix run_tests.py
pull/221/head^2
Nicolas Noble 10 years ago
commit d9076fa88f
  1. 7
      tools/run_tests/build_node.sh
  2. 8
      tools/run_tests/build_php.sh
  3. 10
      tools/run_tests/run_node.sh
  4. 24
      tools/run_tests/run_tests.py

@ -2,19 +2,18 @@
set -ex set -ex
CONFIG=${CONFIG:-opt}
# change to grpc repo root # change to grpc repo root
cd $(dirname $0)/../.. cd $(dirname $0)/../..
# tells npm install to look for files in that directory # tells npm install to look for files in that directory
export GRPC_ROOT=`pwd` export GRPC_ROOT=`pwd`
# tells npm install the subdirectory with library files # 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 # tells npm install not to use default locations
export GRPC_NO_INSTALL=yes export GRPC_NO_INSTALL=yes
# build the c libraries
make -j static_c
cd src/node cd src/node
npm install npm install

@ -2,14 +2,13 @@
set -ex set -ex
CONFIG=${CONFIG:-opt}
# change to grpc repo root # change to grpc repo root
cd $(dirname $0)/../.. cd $(dirname $0)/../..
root=`pwd` root=`pwd`
export GRPC_LIB_SUBDIR=libs/opt export GRPC_LIB_SUBDIR=libs/$CONFIG
# make the libraries
make -j static_c
# build php # build php
cd src/php cd src/php
@ -18,4 +17,3 @@ cd ext/grpc
phpize phpize
./configure --enable-grpc=$root ./configure --enable-grpc=$root
make make

@ -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

@ -46,8 +46,8 @@ class CLanguage(object):
self.make_target = make_target self.make_target = make_target
with open('tools/run_tests/tests.json') as f: with open('tools/run_tests/tests.json') as f:
js = json.load(f) js = json.load(f)
self.binaries = [tgt['name'] self.binaries = [tgt['name']
for tgt in js for tgt in js
if tgt['language'] == test_lang] if tgt['language'] == test_lang]
def test_binaries(self, config): def test_binaries(self, config):
@ -59,6 +59,19 @@ class CLanguage(object):
def build_steps(self): def build_steps(self):
return [] 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): class PhpLanguage(object):
@ -69,7 +82,7 @@ class PhpLanguage(object):
return ['src/php/bin/run_tests.sh'] return ['src/php/bin/run_tests.sh']
def make_targets(self): def make_targets(self):
return [] return ['static_c']
def build_steps(self): def build_steps(self):
return [['tools/run_tests/build_php.sh']] return [['tools/run_tests/build_php.sh']]
@ -107,6 +120,7 @@ _DEFAULT = ['dbg', 'opt']
_LANGUAGES = { _LANGUAGES = {
'c++': CLanguage('cxx', 'c++'), 'c++': CLanguage('cxx', 'c++'),
'c': CLanguage('c', 'c'), 'c': CLanguage('c', 'c'),
'node': NodeLanguage(),
'php': PhpLanguage(), 'php': PhpLanguage(),
'python': PythonLanguage(), 'python': PythonLanguage(),
} }
@ -190,8 +204,8 @@ class TestCache(object):
def _build_and_run(check_cancelled, newline_on_success, cache): def _build_and_run(check_cancelled, newline_on_success, cache):
"""Do one pass of building & running tests.""" """Do one pass of building & running tests."""
# build latest, sharing cpu between the various makes # build latest sequentially
if not jobset.run(build_steps): if not jobset.run(build_steps, maxjobs=1):
return 1 return 1
# run all the tests # run all the tests

Loading…
Cancel
Save