Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
299b2659
Commit
299b2659
authored
May 16, 2016
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow tests to run in verbose mode and multiprocess mode (by turning off TestId mode as needed)
parent
e60114c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
pavelib/utils/test/suites/nose_suite.py
+25
-5
setup.cfg
+0
-1
No files found.
pavelib/utils/test/suites/nose_suite.py
View file @
299b2659
...
...
@@ -6,6 +6,11 @@ from pavelib.utils.test import utils as test_utils
from
pavelib.utils.test.suites.suite
import
TestSuite
from
pavelib.utils.envs
import
Env
try
:
from
pygments.console
import
colorize
except
ImportError
:
colorize
=
lambda
color
,
text
:
text
__test__
=
False
# do not collect
...
...
@@ -33,6 +38,7 @@ class NoseTestSuite(TestSuite):
self
.
test_ids
=
self
.
test_id_dir
/
'noseids'
self
.
extra_args
=
kwargs
.
get
(
'extra_args'
,
''
)
self
.
cov_args
=
kwargs
.
get
(
'cov_args'
,
''
)
self
.
use_ids
=
True
def
__enter__
(
self
):
super
(
NoseTestSuite
,
self
)
.
__enter__
()
...
...
@@ -101,6 +107,9 @@ class NoseTestSuite(TestSuite):
if
self
.
pdb
:
opts
+=
" --pdb"
if
self
.
use_ids
:
opts
+=
" --with-id"
return
opts
...
...
@@ -116,19 +125,30 @@ class SystemTestSuite(NoseTestSuite):
self
.
processes
=
kwargs
.
get
(
'processes'
,
None
)
self
.
randomize
=
kwargs
.
get
(
'randomize'
,
None
)
def
__enter__
(
self
):
super
(
SystemTestSuite
,
self
)
.
__enter__
()
@property
def
cmd
(
self
):
if
self
.
processes
is
None
:
# Use one process per core for LMS tests, and no multiprocessing
# otherwise.
self
.
processes
=
-
1
if
self
.
root
==
'lms'
else
0
self
.
processes
=
int
(
self
.
processes
)
if
self
.
randomize
is
None
:
self
.
randomize
=
self
.
root
==
'lms'
if
self
.
processes
!=
0
and
self
.
verbosity
>
1
:
print
colorize
(
'red'
,
"The TestId module and multiprocessing module can't be run "
"together in verbose mode. Disabling TestId for {} tests."
.
format
(
self
.
root
)
)
self
.
use_ids
=
False
def
__enter__
(
self
):
super
(
SystemTestSuite
,
self
)
.
__enter__
()
@property
def
cmd
(
self
):
cmd
=
[
'./manage.py'
,
self
.
root
,
'test'
,
'--verbosity={}'
.
format
(
self
.
verbosity
),
...
...
setup.cfg
View file @
299b2659
...
...
@@ -2,7 +2,6 @@
logging-clear-handlers=1
with-xunitmp=1
with-ignore-docstrings=1
with-id=1
exclude-dir=lms/envs
cms/envs
...
...
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