Commit db797f12 authored by Romain Courteaud's avatar Romain Courteaud

[software/jstestnode] Allow to run jio test with node

parent 5b06eea6
[buildout]
extends =
../coreutils/buildout.cfg
../patch/buildout.cfg
../git/buildout.cfg
../pkgconfig/buildout.cfg
......@@ -32,6 +33,15 @@ environment =
LDFLAGS=-Wl,-rpath=${gcc:location}/lib -Wl,-rpath=${gcc:location}/lib64 -Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
LD_LIBRARY_PATH=${openssl:location}/lib
[nodejs-8.6.0-output]
# Shared binary location to ease migration
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = ${coreutils-output:test} -x ${:node} -a -x ${:npm}
node = ${nodejs-8.6.0:location}/bin/node
npm = ${nodejs-8.6.0:location}/bin/npm
[nodejs-5]
# Server-side Javascript.
recipe = slapos.recipe.cmmi
......
......@@ -12,6 +12,8 @@ from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from subprocess import check_output
import json
os.environ['TMPDIR'] = '$${xvfb-instance:tmp-path}'
os.environ['DISPLAY'] = ':0'
......@@ -114,6 +116,29 @@ def main():
'platform': args.target,
'version': args.target_version
}
if args.target == 'node':
# Execute NodeJS tests
result_string = check_output(['${nodejs-output:node}', '${jio-repository.git:location}/test/node.js'],
cwd='${jio-repository.git:location}',
env={'CI': 'true'})
result_dict = json.loads(result_string)
for result in result_dict['tests']:
test_line_dict['%s: %s' % (result['module'], result['name'])] = {
'test_count': int(result['total']),
'error_count': 0,
'failure_count': int(result['failed']),
'skip_count': 0,
'duration': int(result['duration']),
'command': '',
'stdout': result['source'],
'stderr': '',
'html_test_result': json.dumps(result['assertions'])
}
else:
# Execute WebBrowser tests
if is_appium:
if not args.appium_server_auth:
raise RuntimeError('--appium_server_auth is required.')
......@@ -179,6 +204,7 @@ def main():
browser.quit()
is_browser_running = False
# Send results
tool = taskdistribution.TaskDistributor(portal_url=args.master_url)
test_result = tool.createTestResult(revision = revision,
test_name_list = test_line_dict.keys(),
......
......@@ -2,6 +2,7 @@
extends =
../../stack/slapos.cfg
../../stack/nodejs.cfg
../../component/coreutils/buildout.cfg
../../component/git/buildout.cfg
../../component/xorg/buildout.cfg
../../component/firefox/buildout.cfg
......@@ -27,6 +28,9 @@ parts =
[nodejs]
<= nodejs-8.6.0
[nodejs-output]
<= nodejs-8.6.0-output
[instance]
recipe = slapos.recipe.template
md5sum = 7c907db5f803b03a218b49888a3a3799
......@@ -52,7 +56,7 @@ develop = true
[renderjs-install]
recipe = plone.recipe.command
stop-on-error = true
command = cd ${renderjs-repository.git:location} && PATH=${git:location}/bin/:${nodejs:location}/bin/:$PATH ${nodejs:location}/bin/npm install . && PATH=${git:location}/bin/:${nodejs:location}/bin/:$PATH ./node_modules/grunt-cli/bin/grunt
command = cd ${renderjs-repository.git:location} && PATH=${git:location}/bin/:${nodejs:location}/bin/:$PATH ${nodejs-output:npm} install . && PATH=${git:location}/bin/:${nodejs:location}/bin/:$PATH ./node_modules/grunt-cli/bin/grunt
update-command = ${:command}
[jio-repository.git]
......@@ -111,7 +115,7 @@ mode = 0644
[template-runTestSuite]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/runTestSuite.in
md5sum = 8528d90cce5d034195e3e71bef855c48
md5sum = 2898d62902351e6df9ce887bd98e2ca1
output = ${buildout:directory}/runTestSuite.in
mode = 0644
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment