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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
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
Hide 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,39 +20,42 @@ FIREFOX_EXECUTABLE = '$${firefox-instance:executable}'
...
@@ -20,39 +20,42 @@ FIREFOX_EXECUTABLE = '$${firefox-instance:executable}'
BASE_URL = 'http://[$${nginx-configuration:ip}]:$${nginx-configuration:port}/'
BASE_URL = 'http://[$${nginx-configuration:ip}]:$${nginx-configuration:port}/'
def main():
def main():
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')
parser.add_argument('--test_node_title', help='The test node title')
parser.add_argument('--project_title', help='The project title')
parser.add_argument('--revision', help='The revision to test',
default='dummy_revision')
parser.add_argument('--node_quantity', help='ignored', type=int)
parser.add_argument('--master_url',
help='The Url of Master controling many suites')
args = parser.parse_args()
test_suite_title = args.test_suite_title or args.test_suite
revision = args.revision
test_line_dict = {}
if ('jio' in test_suite_title):
url = BASE_URL + '/jio/test/tests.html'
else:
url = BASE_URL + '/renderjs/test/'
date = strftime("%Y/%m/%d %H:%M:%S", gmtime())
##########################
# Run all tests
##########################
try:
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')
parser.add_argument('--test_node_title', help='The test node title')
parser.add_argument('--project_title', help='The project title')
parser.add_argument('--revision', help='The revision to test',
default='dummy_revision')
parser.add_argument('--node_quantity', help='ignored', type=int)
parser.add_argument('--master_url',
help='The Url of Master controling many suites')
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):
url = BASE_URL + 'jio/test/tests.html'
else:
url = BASE_URL + 'renderjs/test/'
date = strftime("%Y/%m/%d %H:%M:%S", gmtime())
##########################
# Run all tests
##########################
firefox_binary = webdriver.firefox.firefox_binary.FirefoxBinary(firefox_path=FIREFOX_EXECUTABLE)
firefox_binary = webdriver.firefox.firefox_binary.FirefoxBinary(firefox_path=FIREFOX_EXECUTABLE)
browser = webdriver.Firefox(firefox_binary=firefox_binary)
browser = webdriver.Firefox(firefox_binary=firefox_binary)
agent = browser.execute_script("return navigator.userAgent")
agent = browser.execute_script("return navigator.userAgent")
print agent
print agent
print url
browser.get(url)
browser.get(url)
WebDriverWait(browser, 60).until(EC.presence_of_element_located((
WebDriverWait(browser, 60).until(EC.presence_of_element_located((
...
@@ -87,6 +90,25 @@ def main():
...
@@ -87,6 +90,25 @@ def main():
browser.quit()
browser.quit()
tool = taskdistribution.TaskDistributionTool(portal_url=args.master_url)
test_result = tool.createTestResult(revision = revision,
test_name_list = test_line_dict.keys(),
node_title = args.test_node_title,
test_title = test_suite_title,
project_title = args.project_title)
if test_result is None:
return
# report test results
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:
except Exception:
# 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
...
@@ -97,22 +119,5 @@ def main():
...
@@ -97,22 +119,5 @@ def main():
# XXX: inform test node master of error
# XXX: inform test node master of error
raise EnvironmentError(result)
raise EnvironmentError(result)
tool = taskdistribution.TaskDistributionTool(portal_url=args.master_url)
test_result = tool.createTestResult(revision = revision,
test_name_list = test_line_dict.keys(),
node_title = args.test_node_title,
test_title = test_suite_title,
project_title = args.project_title)
if test_result is None:
return
# report test results
while 1:
test_result_line = test_result.start()
if not test_result_line:
break
# report status back to Nexedi ERP5
test_result_line.stop(**test_line_dict[test_result_line.name])
if __name__ == "__main__":
if __name__ == "__main__":
main()
main()
\ No newline at end of file
software/jstestnode/software.cfg
View file @
ee9683f8
...
@@ -106,7 +106,7 @@ mode = 0644
...
@@ -106,7 +106,7 @@ mode = 0644
[template-runTestSuite]
[template-runTestSuite]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/runTestSuite.in
url = ${:_profile_base_location_}/runTestSuite.in
md5sum =
e2ccc99c510416b7cfa3134799a733fb
md5sum =
57c151675d13fdae1af82664ebe3269f
output = ${buildout:directory}/runTestSuite.in
output = ${buildout:directory}/runTestSuite.in
mode = 0644
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