From 2c8d5165a6ed9f55818af5f7e9e07d7851fc030d Mon Sep 17 00:00:00 2001
From: murgatroid99 <michael.lumish@gmail.com>
Date: Mon, 26 Jan 2015 10:41:21 -0800
Subject: [PATCH] Added node test runner

---
 tools/run_tests/run_node.sh  | 10 ++++++++++
 tools/run_tests/run_tests.py | 18 ++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100644 tools/run_tests/run_node.sh

diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh
new file mode 100644
index 0000000000..76f8a1a4f4
--- /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/node/test
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index da849f04cb..141f1117ab 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 []
+
+  def build_steps(self):
+    return [['tools/run_tests/build_node.sh']]
 
 class PhpLanguage(object):
 
@@ -107,6 +120,7 @@ _DEFAULT = ['dbg', 'opt']
 _LANGUAGES = {
     'c++': CLanguage('cxx', 'c++'),
     'c': CLanguage('c', 'c'),
+    'node': NodeLanguage(),
     'php': PhpLanguage(),
     'python': PythonLanguage(),
 }
-- 
GitLab