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
Vivek
erp5
Commits
e2443534
Commit
e2443534
authored
Apr 22, 2014
by
Kazuhiko Shiozaki
Committed by
Vincent Pelletier
Sep 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
functional test : post result after each test so that we can get results even for timeout case.
parent
3cab1250
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
17 deletions
+39
-17
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
+16
-9
product/Zelenium/selenium/core/scripts/selenium-testrunner.js
...uct/Zelenium/selenium/core/scripts/selenium-testrunner.js
+9
-7
product/Zelenium/www/resultsView.zpt
product/Zelenium/www/resultsView.zpt
+5
-0
product/Zelenium/zuite.py
product/Zelenium/zuite.py
+9
-1
No files found.
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
View file @
e2443534
...
...
@@ -307,7 +307,10 @@ class FunctionalTestRunner:
" to use your existing display instead of Xvfb.")
xvfb.run()
self.browser.run(self._getTestURL() , xvfb.display)
while self.getStatus() is None:
while True:
status = self.getStatus()
if status is not None and not '>ONGOING<' in status:
break
time.sleep(10)
if (time.time() - start) > float(self.timeout):
# TODO: here we could take a screenshot and display it in the report
...
...
@@ -411,18 +414,21 @@ class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
self.runner.remote_code_url_list = self.remote_code_url_list
debug = self.foreground or os.environ.get("erp5_debug_mode")
self.runner.test(debug=debug)
error = None
try:
detail, success, failure,
\
expected_failure, error_title_list = self.runner.processResult()
self.runner.test(debug=debug)
except TimeoutError, e:
error = repr(e)
self._verboseErrorLog(20)
raise
else:
# In case of failure, verbose the error_log entries in order to collect
# appropriated information to debug the system.
if self._hasActivityFailure():
error = 'Failed activities exist.'
self._verboseErrorLog(20)
# In case of failure, verbose the error_log entries in order to collect
# appropriated information to debug the system.
if self._hasActivityFailure():
self._verboseErrorLog(20)
detail, success, failure,
\
expected_failure, error_title_list = self.runner.processResult()
self.logMessage("-" * 79)
total = success + failure + expected_failure
...
...
@@ -437,6 +443,7 @@ class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
self.logMessage(detail)
self.logMessage("-" * 79)
self.assertEqual([], error_title_list, '
\
n
'.join(error_title_list))
self.assertEqual(None, error, error)
# monkey patch HTTPResponse._unauthorized so that we will not have HTTP
# authentication dialog in case of Unauthorized exception to prevent
...
...
product/Zelenium/selenium/core/scripts/selenium-testrunner.js
View file @
e2443534
...
...
@@ -683,12 +683,15 @@ objectExtend(HtmlTestSuite.prototype, {
},
_startCurrentTestCase
:
function
()
{
if
(
this
.
currentRowInSuite
>
1
)
{
new
SeleniumTestResult
(
this
.
failed
,
this
.
getTestTable
()).
post
(
finished
=
false
);
}
this
.
getCurrentRow
().
loadTestCase
(
fnBind
(
htmlTestRunner
.
startTest
,
htmlTestRunner
));
},
_onTestSuiteComplete
:
function
()
{
this
.
markDone
();
new
SeleniumTestResult
(
this
.
failed
,
this
.
getTestTable
()).
post
();
new
SeleniumTestResult
(
this
.
failed
,
this
.
getTestTable
()).
post
(
finished
=
true
);
},
updateSuiteWithResultOfPreviousTest
:
function
()
{
...
...
@@ -740,7 +743,7 @@ objectExtend(SeleniumTestResult.prototype, {
this
.
suiteTable
=
suiteTable
;
},
post
:
function
()
{
post
:
function
(
finished
)
{
if
(
!
this
.
controlPanel
.
isAutomatedRun
())
{
return
;
}
...
...
@@ -782,6 +785,7 @@ objectExtend(SeleniumTestResult.prototype, {
form
.
createHiddenField
(
"
selenium.revision
"
,
Selenium
.
revision
);
form
.
createHiddenField
(
"
result
"
,
this
.
suiteFailed
?
"
failed
"
:
"
passed
"
);
form
.
createHiddenField
(
"
finished
"
,
finished
&&
"
true
"
||
""
);
form
.
createHiddenField
(
"
totalTime
"
,
Math
.
floor
((
this
.
metrics
.
currentTime
-
this
.
metrics
.
startTime
)
/
1000
));
form
.
createHiddenField
(
"
numTestPasses
"
,
this
.
metrics
.
numTestPasses
);
...
...
@@ -797,15 +801,13 @@ objectExtend(SeleniumTestResult.prototype, {
if
(
this
.
suiteTable
.
rows
[
rowNum
].
cells
.
length
>
1
)
{
var
resultCell
=
this
.
suiteTable
.
rows
[
rowNum
].
cells
[
1
];
form
.
createHiddenField
(
"
testTable.
"
+
rowNum
,
resultCell
.
innerHTML
);
// remove the resultCell, so it's not included in the suite HTML
resultCell
.
parentNode
.
removeChild
(
resultCell
);
}
}
form
.
createHiddenField
(
"
numTestTotal
"
,
rowNum
-
1
);
//
Add HTML for the suite itself
form
.
createHiddenField
(
"
suite
"
,
this
.
suiteTable
.
parentNode
.
innerHTML
);
//
We don't use suite for our automated tests.
form
.
createHiddenField
(
"
suite
"
,
''
);
var
logMessages
=
[];
while
(
LOG
.
pendingMessages
.
length
>
0
)
{
...
...
@@ -824,7 +826,7 @@ objectExtend(SeleniumTestResult.prototype, {
form
.
submit
();
}
document
.
body
.
removeChild
(
form
);
if
(
this
.
controlPanel
.
closeAfterTests
())
{
if
(
finished
&&
this
.
controlPanel
.
closeAfterTests
())
{
window
.
top
.
close
();
}
},
...
...
product/Zelenium/www/resultsView.zpt
View file @
e2443534
...
...
@@ -14,10 +14,15 @@
<tr>
<th
align=
"left"
>
Status
</th>
<td>
<tal:block
tal:condition=
"context/finished"
>
<span
style=
"color: green"
tal:condition=
"context/passed"
>
PASSED
</span>
<span
style=
"color: red"
tal:condition=
"not: context/passed"
>
FAILED
</span>
</tal:block>
<tal:block
tal:condition=
"not: context/finished"
>
<span
style=
"color: blue"
>
ONGOING
</span>
</tal:block>
</td>
</tr>
...
...
product/Zelenium/zuite.py
View file @
e2443534
...
...
@@ -317,7 +317,7 @@ class Zuite( OrderedFolder ):
testTable.<n> -- Colorized HTML of each test run
"""
completed
=
DateTime
()
result_id
=
'result_%s'
%
completed
.
strftime
(
'%Y%m%d_%H%M%S'
)
result_id
=
'result_%s'
%
completed
.
strftime
(
'%Y%m%d_%H%M%S
.%f
'
)
self
.
_setObject
(
result_id
,
ZuiteResults
(
result_id
)
)
result
=
self
.
_getOb
(
result_id
)
rfg
=
REQUEST
.
form
.
get
...
...
@@ -331,6 +331,10 @@ class Zuite( OrderedFolder ):
,
rfg
(
'result'
).
lower
()
==
'passed'
)
result
.
_updateProperty
(
'finished'
,
rfg
(
'finished'
).
lower
()
==
'true'
)
result
.
_updateProperty
(
'time_secs'
,
float
(
rfg
(
'totalTime'
,
0
)
)
)
...
...
@@ -594,6 +598,10 @@ class ZuiteResults( Folder ):
,
'type'
:
'date'
,
'mode'
:
'w'
},
{
'id'
:
'finished'
,
'type'
:
'boolean'
,
'mode'
:
'w'
},
{
'id'
:
'passed'
,
'type'
:
'boolean'
,
'mode'
:
'w'
...
...
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