Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos
Commits
5e1ff2de
Commit
5e1ff2de
authored
Aug 30, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/jstestnode: port to python3
parent
702b0a90
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
17 deletions
+14
-17
software/jstestnode/buildout.hash.cfg
software/jstestnode/buildout.hash.cfg
+1
-1
software/jstestnode/runTestSuite.in
software/jstestnode/runTestSuite.in
+12
-12
software/jstestnode/software.cfg
software/jstestnode/software.cfg
+0
-3
software/slapos-sr-testing/software-py3.cfg
software/slapos-sr-testing/software-py3.cfg
+1
-0
software/slapos-sr-testing/software.cfg
software/slapos-sr-testing/software.cfg
+0
-1
No files found.
software/jstestnode/buildout.hash.cfg
View file @
5e1ff2de
...
@@ -27,4 +27,4 @@ md5sum = 98faa5ad8cfb23a11d97a459078a1d05
...
@@ -27,4 +27,4 @@ md5sum = 98faa5ad8cfb23a11d97a459078a1d05
[template-runTestSuite]
[template-runTestSuite]
filename = runTestSuite.in
filename = runTestSuite.in
md5sum =
70d10e7005b98620ddbbf30030b08198
md5sum =
54d585d50a3464100611774db68b72c0
software/jstestnode/runTestSuite.in
View file @
5e1ff2de
...
@@ -33,7 +33,7 @@ def main():
...
@@ -33,7 +33,7 @@ def main():
parser = argparse.ArgumentParser(description='Run a test suite.')
parser = argparse.ArgumentParser(description='Run a test suite.')
parser.add_argument('--test_suite', help='The test suite name',
parser.add_argument('--test_suite', help='The test suite name',
default=parsed_parameters.get('test-suite', ''),
default=parsed_parameters.get('test-suite', ''),
required=
not parsed_parameters.has_key('test-suite')
)
required=
'test-suite' not in parsed_parameters
)
parser.add_argument('--test_suite_title', help='The test suite title')
parser.add_argument('--test_suite_title', help='The test suite title')
parser.add_argument('--test_node_title', help='The test node title')
parser.add_argument('--test_node_title', help='The test node title')
parser.add_argument('--project_title', help='The project title')
parser.add_argument('--project_title', help='The project title')
...
@@ -96,7 +96,7 @@ def main():
...
@@ -96,7 +96,7 @@ def main():
firefox_binary='${firefox-wrapper-68:location}',
firefox_binary='${firefox-wrapper-68:location}',
executable_path='${geckodriver:location}')
executable_path='${geckodriver:location}')
else:
else:
assert target == 'selenium-server',
"Unsupported target {}".format(test_runner['target'])
assert target == 'selenium-server',
f"Unsupported target {test_runner['target']}"
# use a remote connection which optionally verifies TLS certificate
# use a remote connection which optionally verifies TLS certificate
# and optionally against a user provided CA.
# and optionally against a user provided CA.
executor = RemoteConnection(test_runner['server-url'], keep_alive=True)
executor = RemoteConnection(test_runner['server-url'], keep_alive=True)
...
@@ -120,14 +120,14 @@ def main():
...
@@ -120,14 +120,14 @@ def main():
remote_access_url = parsed_parameters.get('remote-access-url')
remote_access_url = parsed_parameters.get('remote-access-url')
if remote_access_url:
if remote_access_url:
if ('jio' in test_suite):
if ('jio' in test_suite):
url =
'{}/jio/test/tests.html'.format(remote_access_url)
url =
f'{remote_access_url}/jio/test/tests.html'
else:
else:
url =
'{}/renderjs/test/'.format(remote_access_url)
url =
f'{remote_access_url}/renderjs/test'
is_browser_running = True
is_browser_running = True
agent = browser.execute_script("return navigator.userAgent")
agent = browser.execute_script("return navigator.userAgent")
print
agent
print
(agent)
print
url
print
(url)
browser.get(url)
browser.get(url)
WebDriverWait(browser, 300).until(EC.presence_of_element_located((
WebDriverWait(browser, 300).until(EC.presence_of_element_located((
...
@@ -137,7 +137,7 @@ def main():
...
@@ -137,7 +137,7 @@ def main():
html_parser = etree.HTMLParser(recover=True)
html_parser = etree.HTMLParser(recover=True)
body = etree.fromstring(browser.page_source.encode('UTF-8'), html_parser)
body = etree.fromstring(browser.page_source.encode('UTF-8'), html_parser)
print
' '.join(body.xpath('//*[@id="qunit-testresult"]//text()'
))
print
(' '.join(body.xpath('//*[@id="qunit-testresult"]//text()')
))
for elt in body.xpath('.//ol[@id="qunit-tests"]/li'):
for elt in body.xpath('.//ol[@id="qunit-tests"]/li'):
if (len(elt.xpath('.//span[@class="module-name"]'))):
if (len(elt.xpath('.//span[@class="module-name"]'))):
...
@@ -149,7 +149,7 @@ def main():
...
@@ -149,7 +149,7 @@ def main():
else:
else:
test_name = elt.xpath('.//span[@class="test-name"]')[0].text
test_name = elt.xpath('.//span[@class="test-name"]')[0].text
print
elt.get('class'), ''.join(elt.xpath('.//strong')[0].itertext(
))
print
(elt.get('class'), ''.join(elt.xpath('.//strong')[0].itertext()
))
# print elt.find_element_by_tag_name('ol').get_attribute('innerHTML')
# print elt.find_element_by_tag_name('ol').get_attribute('innerHTML')
failure = int(elt.xpath('.//b[@class="failed"]')[0].text)
failure = int(elt.xpath('.//b[@class="failed"]')[0].text)
...
@@ -176,7 +176,7 @@ def main():
...
@@ -176,7 +176,7 @@ def main():
# Send results
# Send results
tool = taskdistribution.TaskDistributor(portal_url=args.master_url)
tool = taskdistribution.TaskDistributor(portal_url=args.master_url)
test_result = tool.createTestResult(revision = revision,
test_result = tool.createTestResult(revision = revision,
test_name_list =
test_line_dict.keys(
),
test_name_list =
list(test_line_dict.keys()
),
node_title = args.test_node_title,
node_title = args.test_node_title,
test_title = test_suite_title,
test_title = test_suite_title,
project_title = args.project_title)
project_title = args.project_title)
...
@@ -186,17 +186,17 @@ def main():
...
@@ -186,17 +186,17 @@ def main():
while 1:
while 1:
test_result_line = test_result.start()
test_result_line = test_result.start()
if not test_result_line:
if not test_result_line:
print
'No test result anymore.'
print
('No test result anymore.')
break
break
print
'Submitting: "%s"' % test_result_line.name
print
('Submitting: "%s"' % test_result_line.name)
# report status back to Nexedi ERP5
# report status back to Nexedi ERP5
test_result_line.stop(**test_line_dict[test_result_line.name])
test_result_line.stop(**test_line_dict[test_result_line.name])
except:
except:
# Catch any exception here, to warn user instead of being silent,
# Catch any exception here, to warn user instead of being silent,
# by generating fake error result
# by generating fake error result
print
traceback.format_exc(
)
print
(traceback.format_exc()
)
result = dict(status_code=-1,
result = dict(status_code=-1,
command=url,
command=url,
stderr=traceback.format_exc(),
stderr=traceback.format_exc(),
...
...
software/jstestnode/software.cfg
View file @
5e1ff2de
...
@@ -29,9 +29,6 @@ parts =
...
@@ -29,9 +29,6 @@ parts =
openssl
openssl
instance
instance
[python]
part = python2.7
[nodejs]
[nodejs]
<= nodejs-14.16.0
<= nodejs-14.16.0
...
...
software/slapos-sr-testing/software-py3.cfg
View file @
5e1ff2de
...
@@ -20,6 +20,7 @@ extra =
...
@@ -20,6 +20,7 @@ extra =
helloworld ${slapos.test.helloworld-setup:setup}
helloworld ${slapos.test.helloworld-setup:setup}
html5as ${slapos.test.html5as-setup:setup}
html5as ${slapos.test.html5as-setup:setup}
hugo ${slapos.test.hugo-setup:setup}
hugo ${slapos.test.hugo-setup:setup}
jstestnode ${slapos.test.jstestnode-setup:setup}
jupyter ${slapos.test.jupyter-setup:setup}
jupyter ${slapos.test.jupyter-setup:setup}
kvm ${slapos.test.kvm-setup:setup}
kvm ${slapos.test.kvm-setup:setup}
matomo ${slapos.test.matomo-setup:setup}
matomo ${slapos.test.matomo-setup:setup}
...
...
software/slapos-sr-testing/software.cfg
View file @
5e1ff2de
...
@@ -376,7 +376,6 @@ extra =
...
@@ -376,7 +376,6 @@ extra =
html5as-base ${slapos.test.html5as-base-setup:setup}
html5as-base ${slapos.test.html5as-base-setup:setup}
htmlvalidatorserver ${slapos.test.htmlvalidatorserver-setup:setup}
htmlvalidatorserver ${slapos.test.htmlvalidatorserver-setup:setup}
jscrawler ${slapos.test.jscrawler-setup:setup}
jscrawler ${slapos.test.jscrawler-setup:setup}
jstestnode ${slapos.test.jstestnode-setup:setup}
re6stnet ${slapos.test.re6stnet-setup:setup}
re6stnet ${slapos.test.re6stnet-setup:setup}
slapos-master ${slapos.test.slapos-master-setup:setup}
slapos-master ${slapos.test.slapos-master-setup:setup}
slaprunner ${slapos.test.slaprunner-setup:setup}
slaprunner ${slapos.test.slaprunner-setup:setup}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment