Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
isaak yansane-sisk
slapos
Commits
ee9683f8
Commit
ee9683f8
authored
Apr 04, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jstestnode: catch all errors
parent
b3685251
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
45 deletions
+50
-45
software/jstestnode/runTestSuite.in
software/jstestnode/runTestSuite.in
+49
-44
software/jstestnode/software.cfg
software/jstestnode/software.cfg
+1
-1
No files found.
software/jstestnode/runTestSuite.in
View file @
ee9683f8
...
...
@@ -20,6 +20,7 @@ FIREFOX_EXECUTABLE = '$${firefox-instance:executable}'
BASE_URL = 'http://[$${nginx-configuration:ip}]:$${nginx-configuration:port}/'
def main():
try:
parser = argparse.ArgumentParser(description='Run a test suite.')
parser.add_argument('--test_suite', help='The test suite name')
parser.add_argument('--test_suite_title', help='The test suite title')
...
...
@@ -34,25 +35,27 @@ def main():
args = parser.parse_args()
test_suite_title = args.test_suite_title or args.test_suite
test_suite = args.test_suite
revision = args.revision
test_line_dict = {}
if ('jio' in test_suite_titl
e):
url = BASE_URL + '/
jio/test/tests.html'
if ('jio' in test_suit
e):
url = BASE_URL + '
jio/test/tests.html'
else:
url = BASE_URL + '/
renderjs/test/'
url = BASE_URL + '
renderjs/test/'
date = strftime("%Y/%m/%d %H:%M:%S", gmtime())
##########################
# Run all tests
##########################
try:
firefox_binary = webdriver.firefox.firefox_binary.FirefoxBinary(firefox_path=FIREFOX_EXECUTABLE)
browser = webdriver.Firefox(firefox_binary=firefox_binary)
agent = browser.execute_script("return navigator.userAgent")
print agent
print url
browser.get(url)
WebDriverWait(browser, 60).until(EC.presence_of_element_located((
...
...
@@ -87,16 +90,6 @@ def main():
browser.quit()
except Exception:
# Catch any exception here, to warn user instead of being silent,
# by generating fake error result
result = dict(status_code=-1,
command=url,
stderr=traceback.format_exc(),
stdout='')
# XXX: inform test node master of error
raise EnvironmentError(result)
tool = taskdistribution.TaskDistributionTool(portal_url=args.master_url)
test_result = tool.createTestResult(revision = revision,
test_name_list = test_line_dict.keys(),
...
...
@@ -109,10 +102,22 @@ def main():
while 1:
test_result_line = test_result.start()
if not test_result_line:
print 'No test result anymore.'
break
print 'Submitting: "%s"' % test_result_line.name
# report status back to Nexedi ERP5
test_result_line.stop(**test_line_dict[test_result_line.name])
except Exception:
# Catch any exception here, to warn user instead of being silent,
# by generating fake error result
result = dict(status_code=-1,
command=url,
stderr=traceback.format_exc(),
stdout='')
# XXX: inform test node master of error
raise EnvironmentError(result)
if __name__ == "__main__":
main()
\ No newline at end of file
software/jstestnode/software.cfg
View file @
ee9683f8
...
...
@@ -106,7 +106,7 @@ mode = 0644
[template-runTestSuite]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/runTestSuite.in
md5sum =
e2ccc99c510416b7cfa3134799a733fb
md5sum =
57c151675d13fdae1af82664ebe3269f
output = ${buildout:directory}/runTestSuite.in
mode = 0644
...
...
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