Commit a49d923f authored by Sebastien Robin's avatar Sebastien Robin

live_test: clearly decrease risk of not having result in web page

From time to time, it happened that after hitting button "run live test" the
result was not displayed even though the test was running. This hack should
clearly reduce the risk. If there is still issues from time to time, we will need
to improve design.
parent f8c832bc
......@@ -12,7 +12,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts09819354.83</string> </value>
<value> <string>ts09819502.02</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -80,7 +80,10 @@
});\n
};\n
var x=0;\n
get_data();\n
// Not perfect, but the timeout should clearly reduce risk of getting empty result\n
// while the runUnitTest command had no time yet to reset global variable\n
// on ERP5 side\n
setTimeout(get_data,2000);\n
\n
});</string> </value>
</item>
......@@ -90,7 +93,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1934</int> </value>
<value> <int>2134</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
13
\ No newline at end of file
14
\ No newline at end of file
......@@ -277,6 +277,9 @@ class Test(ERP5TypeTestCase):
debug=boolean Invoke debugger on errors / failures.
verbose=boolean Display more information when running tests
"""
from StringIO import StringIO
global global_stream
global_stream = StringIO()
test_list = self._getCommaSeparatedParameterList(test_list)
if not test_list:
# no test to run
......@@ -288,9 +291,6 @@ class Test(ERP5TypeTestCase):
run_only = self._getCommaSeparatedParameterList(run_only)
verbosity = verbose and 2 or 1
from StringIO import StringIO
global global_stream
global_stream = StringIO()
from Products.ERP5Type.tests.ERP5TypeLiveTestCase import runLiveTest
try:
result = runLiveTest(test_list,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment