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
Labels
Merge Requests
139
Merge Requests
139
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
07e28bf7
Commit
07e28bf7
authored
Oct 04, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runUnitTest: new --log_directory option
Log files will be created in this directory.
parent
34601253
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
product/ERP5Type/tests/ProcessingNodeTestCase.py
product/ERP5Type/tests/ProcessingNodeTestCase.py
+2
-2
product/ERP5Type/tests/runUnitTest.py
product/ERP5Type/tests/runUnitTest.py
+8
-1
No files found.
product/ERP5Type/tests/ProcessingNodeTestCase.py
View file @
07e28bf7
...
...
@@ -149,8 +149,8 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
"""Start HTTP ZServer in background"""
utils
=
ZopeTestCase
.
utils
if
utils
.
_Z2HOST
is
None
:
from
Products.ERP5Type.tests.runUnitTest
import
tests_home
log
=
os
.
path
.
join
(
tests_home
,
"Z2.log"
)
from
Products.ERP5Type.tests.runUnitTest
import
log_directory
log
=
os
.
path
.
join
(
log_directory
,
"Z2.log"
)
message
=
"Running %s server at %s:%s
\
n
"
if
int
(
os
.
environ
.
get
(
'erp5_wsgi'
,
0
)):
from
Products.ERP5.bin.zopewsgi
import
app_wrapper
,
createServer
...
...
product/ERP5Type/tests/runUnitTest.py
View file @
07e28bf7
...
...
@@ -158,6 +158,7 @@ Options:
--sys_path=path,path Comma-separated list of paths which will be used to
extend sys.path
--instance_home=PATH Create/use test instance in given path
--log_directory=PATH Create log files in given path
When no unit test is specified, only activities are processed.
"""
...
...
@@ -492,7 +493,7 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
_print
(
"conflicting options: --zeo_client and --zeo_server"
)
sys
.
exit
(
1
)
instance_home
=
os
.
environ
[
'INSTANCE_HOME'
]
os
.
environ
.
setdefault
(
'EVENT_LOG_FILE'
,
os
.
path
.
join
(
tests_home
,
'zLOG.log'
))
os
.
environ
.
setdefault
(
'EVENT_LOG_FILE'
,
os
.
path
.
join
(
log_directory
,
'zLOG.log'
))
os
.
environ
.
setdefault
(
'EVENT_LOG_SEVERITY'
,
'-300'
)
# For numpy parallel-primitives such as numpy.dot() that is used in
# testReceiptRecognition for example.
...
...
@@ -759,6 +760,7 @@ def main(argument_list=None):
"products_path="
,
"sys_path="
,
"instance_home="
,
"log_directory="
])
except
getopt
.
GetoptError
,
msg
:
usage
(
sys
.
stderr
,
msg
)
...
...
@@ -769,6 +771,7 @@ def main(argument_list=None):
debug
=
0
run_only
=
None
instance_home
=
os
.
path
.
join
(
real_instance_home
,
'unit_test'
)
_log_directory
=
instance_home
bt5_path_list
=
[]
...
...
@@ -877,6 +880,8 @@ def main(argument_list=None):
sys
.
path
.
extend
(
arg
.
split
(
','
))
elif
opt
==
"--instance_home"
:
instance_home
=
os
.
path
.
abspath
(
arg
)
elif
opt
==
"--log_directory"
:
_log_directory
=
os
.
path
.
abspath
(
arg
)
bt5_path_list
+=
filter
(
None
,
os
.
environ
.
get
(
"erp5_tests_bt5_path"
,
""
).
split
(
','
))
...
...
@@ -895,6 +900,8 @@ def main(argument_list=None):
initializeInstanceHome
(
tests_framework_home
,
real_instance_home
,
instance_home
)
global
log_directory
log_directory
=
_log_directory
or
test_home
result
=
runUnitTestList
(
test_list
=
args
,
verbosity
=
verbosity
,
...
...
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