Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Douglas
erp5
Commits
4aaacd03
Commit
4aaacd03
authored
Nov 02, 2012
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
give more details when Xvfb or firefox fails to launch in functional tests
parent
de26b39d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
+10
-5
No files found.
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
View file @
4aaacd03
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
##############################################################################
##############################################################################
import
os
import
os
import
sys
import
time
import
time
import
signal
import
signal
import
re
import
re
...
@@ -83,7 +84,8 @@ class Xvfb:
...
@@ -83,7 +84,8 @@ class Xvfb:
if subprocess.call(('
xdpyinfo
', '
-
display
', display),
if subprocess.call(('
xdpyinfo
', '
-
display
', display),
stdout=null, stderr=subprocess.STDOUT):
stdout=null, stderr=subprocess.STDOUT):
# Xvfb did not start properly so stop here
# Xvfb did not start properly so stop here
raise EnvironmentError("Can not start Xvfb, stop test execution")
raise EnvironmentError("Can not start Xvfb, stop test execution "
\
+ "(display %r)" % (display,))
def run(self):
def run(self):
for display_try in self.display_list:
for display_try in self.display_list:
...
@@ -108,6 +110,7 @@ class Browser:
...
@@ -108,6 +110,7 @@ class Browser:
self.port = port
self.port = port
def quit(self):
def quit(self):
if getattr(self, "process", None) is not None:
self.process.kill()
self.process.kill()
def _run(self, url, display):
def _run(self, url, display):
...
@@ -261,8 +264,8 @@ class FunctionalTestRunner:
...
@@ -261,8 +264,8 @@ class FunctionalTestRunner:
self.user, self.password)
self.user, self.password)
def test(self, debug=0):
def test(self, debug=0):
xvfb = Xvfb(self.instance_home)
try:
try:
xvfb = Xvfb(self.instance_home)
start = time.time()
start = time.time()
if not debug:
if not debug:
print("
\
n
Set 'erp5_debug_mode' environment variable to 1"
print("
\
n
Set 'erp5_debug_mode' environment variable to 1"
...
@@ -274,10 +277,12 @@ class FunctionalTestRunner:
...
@@ -274,10 +277,12 @@ class FunctionalTestRunner:
if (time.time() - start) > float(self.timeout):
if (time.time() - start) > float(self.timeout):
raise TimeoutError("Test took more than %s seconds" % self.timeout)
raise TimeoutError("Test took more than %s seconds" % self.timeout)
except:
except:
print("ERP5TypeFunctionalTestCase.test Exception: %r" % (sys.exc_info(),)
print("ERP5TypeFunctionalTestCase.test Exception: %r" % (sys.exc_info(),))
raise
finally:
finally:
self.browser.quit()
xvfb.quit()
xvfb.quit()
if getattr(self, "browser", None) is not None:
self.browser.quit()
def processResult(self):
def processResult(self):
file_content = self.getStatus().encode("utf-8", "replace")
file_content = self.getStatus().encode("utf-8", "replace")
...
...
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