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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
preetwinder
erp5
Commits
8fab4d97
Commit
8fab4d97
authored
Oct 23, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LiveTest: set SERVER_URL in the test request so that tests run with same URL as the host
parent
8e41eb66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
product/ERP5Type/Tool/ComponentTool.py
product/ERP5Type/Tool/ComponentTool.py
+2
-0
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
+10
-1
No files found.
product/ERP5Type/Tool/ComponentTool.py
View file @
8fab4d97
...
...
@@ -295,6 +295,7 @@ class Test(ERP5TypeTestCase):
debug
=
int
(
debug
)
and
True
or
False
run_only
=
self
.
_getCommaSeparatedParameterList
(
run_only
)
verbosity
=
verbose
and
2
or
1
request_server_url
=
self
.
REQUEST
.
get
(
'SERVER_URL'
)
try
:
live_test_running
=
True
...
...
@@ -304,6 +305,7 @@ class Test(ERP5TypeTestCase):
run_only
=
run_only
,
debug
=
debug
,
stream
=
global_stream
,
request_server_url
=
request_server_url
,
verbosity
=
verbosity
)
except
ImportError
:
import
traceback
...
...
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
View file @
8fab4d97
...
...
@@ -51,6 +51,7 @@ from Products.ERP5Type.tests import ProcessingNodeTestCase as\
ProcessingNodeTestCaseModule
ProcessingNodeTestCaseModule
.
patchActivityTool
=
lambda
:
None
_request_server_url
=
None
class
ERP5TypeLiveTestCase
(
ERP5TypeTestCaseMixin
):
"""ERP5TypeLiveTestCase is the default class for *all* tests
...
...
@@ -109,6 +110,11 @@ class ERP5TypeLiveTestCase(ERP5TypeTestCaseMixin):
with
patches
.
_requests_lock
:
patches
.
_requests
[
thread
.
get_ident
()]
=
request
# Make live tests run under the same server URL than the host instance.
if
_request_server_url
:
request
[
'SERVER_URL'
]
=
_request_server_url
request
.
_resetURLS
()
self
.
portal
=
portal
return
portal
...
...
@@ -184,7 +190,7 @@ class ERP5TypeLiveTestLoader(ERP5TypeTestLoader):
return
super
(
ERP5TypeLiveTestLoader
,
self
).
loadTestsFromName
(
name
,
module
)
def
runLiveTest
(
test_list
,
verbosity
=
1
,
stream
=
None
,
**
kw
):
def
runLiveTest
(
test_list
,
verbosity
=
1
,
stream
=
None
,
request_server_url
=
None
,
**
kw
):
from
Products.ERP5Type.tests.runUnitTest
import
DebugTestResult
from
StringIO
import
StringIO
# Add path of the TestTemplateItem folder of the instance
...
...
@@ -197,6 +203,9 @@ def runLiveTest(test_list, verbosity=1, stream=None, **kw):
product_test_list
.
extend
(
glob
(
os
.
path
.
join
(
product_path
,
'*'
,
'tests'
)))
current_syspath
=
set
(
sys
.
path
)
global
_request_server_url
_request_server_url
=
request_server_url
sys
.
path
.
extend
(
path
for
path
in
product_test_list
if
path
not
in
current_syspath
)
...
...
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