aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/dockerfile/test/node_jessie_x64/Dockerfile7
-rw-r--r--tools/run_tests/artifacts/build_artifact_node.bat8
-rwxr-xr-xtools/run_tests/artifacts/build_artifact_node.sh8
-rwxr-xr-xtools/run_tests/helper_scripts/build_node_electron.sh46
-rwxr-xr-xtools/run_tests/helper_scripts/pre_build_node_electron.sh39
-rwxr-xr-xtools/run_tests/helper_scripts/run_node_electron.sh45
-rwxr-xr-xtools/run_tests/run_tests.py33
-rwxr-xr-xtools/run_tests/run_tests_matrix.py9
8 files changed, 189 insertions, 6 deletions
diff --git a/tools/dockerfile/test/node_jessie_x64/Dockerfile b/tools/dockerfile/test/node_jessie_x64/Dockerfile
index d9a7501829..120ea59ae2 100644
--- a/tools/dockerfile/test/node_jessie_x64/Dockerfile
+++ b/tools/dockerfile/test/node_jessie_x64/Dockerfile
@@ -42,12 +42,18 @@ RUN apt-get update && apt-get install -y \
git \
golang \
gyp \
+ libasound2 \
lcov \
libc6 \
libc6-dbg \
libc6-dev \
+ libgconf-2-4 \
libgtest-dev \
+ libgtk2.0-0 \
+ libnss3 \
libtool \
+ libxss1\
+ libxtst6 \
make \
perl \
strace \
@@ -57,6 +63,7 @@ RUN apt-get update && apt-get install -y \
telnet \
unzip \
wget \
+ xvfb \
zip && apt-get clean
#================
diff --git a/tools/run_tests/artifacts/build_artifact_node.bat b/tools/run_tests/artifacts/build_artifact_node.bat
index 2e0ecd21d0..7439b76eb1 100644
--- a/tools/run_tests/artifacts/build_artifact_node.bat
+++ b/tools/run_tests/artifacts/build_artifact_node.bat
@@ -29,6 +29,8 @@
set node_versions=0.12.0 1.0.0 1.1.0 2.0.0 3.0.0 4.0.0 5.0.0 6.0.0 7.0.0
+set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0
+
set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
del /f /q BUILD || rmdir build /s /q
@@ -47,6 +49,12 @@ for %%v in (%node_versions%) do (
xcopy /Y /I /S build\stage\* artifacts\ || goto :error
)
+
+for %%v in (%electron_versions%) do (
+ call .\node_modules\.bin\node-pre-gyp.cmd configure rebuild package testpackage --runtime=electron --target=%%v --target_arch=%1 || goto :error
+
+ xcopy /Y /I /S build\stage\* artifacts\ || goto :error
+)
if %errorlevel% neq 0 exit /b %errorlevel%
goto :EOF
diff --git a/tools/run_tests/artifacts/build_artifact_node.sh b/tools/run_tests/artifacts/build_artifact_node.sh
index 1066ebde19..02497a4db9 100755
--- a/tools/run_tests/artifacts/build_artifact_node.sh
+++ b/tools/run_tests/artifacts/build_artifact_node.sh
@@ -44,8 +44,16 @@ npm update
node_versions=( 0.12.0 1.0.0 1.1.0 2.0.0 3.0.0 4.0.0 5.0.0 6.0.0 7.0.0 )
+electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 )
+
for version in ${node_versions[@]}
do
./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --target=$version --target_arch=$NODE_TARGET_ARCH
cp -r build/stage/* artifacts/
done
+
+for version in ${node_versions[@]}
+do
+ HOME=~/.electron-gyp ./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --runtime=electron --target=$version --target_arch=$NODE_TARGET_ARCH
+ cp -r build/stage/* artifacts/
+done
diff --git a/tools/run_tests/helper_scripts/build_node_electron.sh b/tools/run_tests/helper_scripts/build_node_electron.sh
new file mode 100755
index 0000000000..1c95c513b3
--- /dev/null
+++ b/tools/run_tests/helper_scripts/build_node_electron.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# Copyright 2016, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ELECTRON_VERSION=$1
+source ~/.nvm/nvm.sh
+
+nvm use 6
+set -ex
+
+# change to grpc repo root
+cd $(dirname $0)/../..
+
+export npm_config_target=$ELECTRON_VERSION
+export npm_config_disturl=https://atom.io/download/atom-shell
+export npm_config_runtime=electron
+export npm_config_build_from_source=true
+mkdir -p ~/.electron-gyp
+HOME=~/.electron-gyp npm install --unsafe-perm
diff --git a/tools/run_tests/helper_scripts/pre_build_node_electron.sh b/tools/run_tests/helper_scripts/pre_build_node_electron.sh
new file mode 100755
index 0000000000..95c56aa509
--- /dev/null
+++ b/tools/run_tests/helper_scripts/pre_build_node_electron.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# Copyright 2016, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ELECTRON_VERSION=$1
+
+nvm install 6
+set -ex
+
+npm install xvfb-maybe
+
+npm install electron@$ELECTRON_VERSION
diff --git a/tools/run_tests/helper_scripts/run_node_electron.sh b/tools/run_tests/helper_scripts/run_node_electron.sh
new file mode 100755
index 0000000000..1999ffb0fa
--- /dev/null
+++ b/tools/run_tests/helper_scripts/run_node_electron.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# Copyright 2015, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+source ~/.nvm/nvm.sh
+
+nvm use 6
+set -ex
+
+# change to grpc repo root
+cd $(dirname $0)/../..
+
+test_directory='src/node/test'
+timeout=8000
+
+JUNIT_REPORT_PATH=src/node/report.xml JUNIT_REPORT_STACK=1 \
+ ./node_modules/.bin/xvfb-maybe \
+ ./node_modules/.bin/electron-mocha --timeout $timeout \
+ --reporter mocha-jenkins-reporter $test_directory
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 924274191e..ab719a6727 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -371,27 +371,42 @@ class NodeLanguage(object):
def configure(self, config, args):
self.config = config
self.args = args
+ # Note: electron ABI only depends on major and minor version, so that's all
+ # we should specify in the compiler argument
_check_compiler(self.args.compiler, ['default', 'node0.12',
'node4', 'node5', 'node6',
- 'node7'])
+ 'node7', 'electron1.3'])
if self.args.compiler == 'default':
self.node_version = '4'
else:
- # Take off the word "node"
- self.node_version = self.args.compiler[4:]
+ if self.args.compiler.startswith('electron'):
+ self.runtime = 'electron'
+ self.node_version = self.args.compiler[8:]
+ else:
+ self.runtime = 'node'
+ # Take off the word "node"
+ self.node_version = self.args.compiler[4:]
def test_specs(self):
if self.platform == 'windows':
return [self.config.job_spec(['tools\\run_tests\\helper_scripts\\run_node.bat'])]
else:
- return [self.config.job_spec(['tools/run_tests/helper_scripts/run_node.sh', self.node_version],
+ run_script = 'run_node'
+ if self.runtime == 'electron':
+ run_script += '_electron'
+ return [self.config.job_spec(['tools/run_tests/helper_scripts/{}.sh'.format(run_script),
+ self.node_version],
+ None,
environ=_FORCE_ENVIRON_FOR_WRAPPERS)]
def pre_build_steps(self):
if self.platform == 'windows':
return [['tools\\run_tests\\helper_scripts\\pre_build_node.bat']]
else:
- return [['tools/run_tests/helper_scripts/pre_build_node.sh', self.node_version]]
+ build_script = 'pre_build_node'
+ if self.runtime == 'electron':
+ build_script += '_electron'
+ return [['tools/run_tests/helper_scripts/{}.sh'.format(build_script), self.node_version]]
def make_targets(self):
return []
@@ -403,7 +418,12 @@ class NodeLanguage(object):
if self.platform == 'windows':
return [['tools\\run_tests\\helper_scripts\\build_node.bat']]
else:
- return [['tools/run_tests/helper_scripts/build_node.sh', self.node_version]]
+ build_script = 'build_node'
+ if self.runtime == 'electron':
+ build_script += '_electron'
+ # building for electron requires a patch version
+ self.node_version += '.0'
+ return [['tools/run_tests/helper_scripts/{}.sh'.format(build_script), self.node_version]]
def post_tests_steps(self):
return []
@@ -1076,6 +1096,7 @@ argp.add_argument('--compiler',
'vs2010', 'vs2013', 'vs2015',
'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3',
'node0.12', 'node4', 'node5', 'node6', 'node7',
+ 'electron1.3',
'coreclr'],
default='default',
help='Selects compiler to use. Allowed values depend on the platform and language.')
diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py
index 6e83180c66..8f70a6d2ea 100755
--- a/tools/run_tests/run_tests_matrix.py
+++ b/tools/run_tests/run_tests_matrix.py
@@ -231,6 +231,15 @@ def _create_portability_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS)
labels=['portability'],
extra_args=extra_args,
inner_jobs=inner_jobs)
+
+ test_jobs += _generate_jobs(languages=['node'],
+ configs=['dbg'],
+ platforms=['linux'],
+ arch='default',
+ compiler='electron1.3',
+ labels=['portability'],
+ extra_args=extra_args,
+ inner_jobs=inner_jobs)
return test_jobs