Merge pull request #5234 from soltanmm/testfix
Fix Python unit tests
diff --git a/package.json b/package.json
index df976fd..b3888af 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"test": "./node_modules/.bin/mocha src/node/test && npm run-script lint",
"gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test",
- "install": "node-pre-gyp install --fallback-to-build"
+ "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build"
},
"bundledDependencies": ["node-pre-gyp"],
"dependencies": {
diff --git a/templates/package.json.template b/templates/package.json.template
index ba2a078..99e8287 100644
--- a/templates/package.json.template
+++ b/templates/package.json.template
@@ -25,7 +25,7 @@
"test": "./node_modules/.bin/mocha src/node/test && npm run-script lint",
"gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test",
- "install": "node-pre-gyp install --fallback-to-build"
+ "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build"
},
"bundledDependencies": ["node-pre-gyp"],
"dependencies": {
diff --git a/test/distrib/node/run_distrib_test.sh b/test/distrib/node/run_distrib_test.sh
index 99a51f0..9b8f157 100755
--- a/test/distrib/node/run_distrib_test.sh
+++ b/test/distrib/node/run_distrib_test.sh
@@ -38,6 +38,9 @@
npm install -g node-static
+# Kill off existing static servers
+kill -9 $(ps aux | grep '[n]ode .*static' | awk '{print $2}') || true
+
STATIC_SERVER=127.0.0.1
STATIC_PORT=8080
diff --git a/tools/buildgen/plugins/expand_version.py b/tools/buildgen/plugins/expand_version.py
index a103618..b55e1b1 100755
--- a/tools/buildgen/plugins/expand_version.py
+++ b/tools/buildgen/plugins/expand_version.py
@@ -51,6 +51,7 @@
class Version:
def __init__(self, s):
+ self.tag = None
if '-' in s:
s, self.tag = s.split('-')
self.major, self.minor, self.patch = [int(x) for x in s.split('.')]
@@ -78,7 +79,10 @@
def ruby(self):
"""Version string in Ruby style"""
- return '%d.%d.%d.%s' % (self.major, self.minor, self.patch, self.tag)
+ if self.tag:
+ return '%d.%d.%d.%s' % (self.major, self.minor, self.patch, self.tag)
+ else:
+ return '%d.%d.%d' % (self.major, self.minor, self.patch)
def mako_plugin(dictionary):
"""Expand version numbers:
diff --git a/tools/run_tests/build_artifact_node.sh b/tools/run_tests/build_artifact_node.sh
index 9a3b9bd..6aa4824 100755
--- a/tools/run_tests/build_artifact_node.sh
+++ b/tools/run_tests/build_artifact_node.sh
@@ -36,7 +36,7 @@
cd $(dirname $0)/../..
-rm -rf build
+rm -rf build || true
mkdir -p artifacts
@@ -46,6 +46,6 @@
for version in ${node_versions[@]}
do
- node-pre-gyp configure rebuild package testpackage --target=$version --target_arch=$NODE_TARGET_ARCH
+ ./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --target=$version --target_arch=$NODE_TARGET_ARCH
cp -r build/stage/* artifacts/
done
diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py
index fe26fd5..261f44b 100644
--- a/tools/run_tests/distribtest_targets.py
+++ b/tools/run_tests/distribtest_targets.py
@@ -240,10 +240,7 @@
RubyDistribTest('linux', 'x64', 'ubuntu1504'),
RubyDistribTest('linux', 'x64', 'ubuntu1510'),
RubyDistribTest('linux', 'x64', 'ubuntu1604'),
- NodeDistribTest('macos', 'x64', None, '0.12'),
- NodeDistribTest('macos', 'x64', None, '3'),
NodeDistribTest('macos', 'x64', None, '4'),
- NodeDistribTest('macos', 'x64', None, '5'),
NodeDistribTest('linux', 'x86', 'jessie', '4')
] + [
NodeDistribTest('linux', 'x64', os, version)