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
4221bf9e
Commit
4221bf9e
authored
Jun 06, 2014
by
David Baumgold
Committed by
Christine Lytwynec
Jun 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set verbosity on paver test tasks
parent
da6d70a9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
8 deletions
+44
-8
pavelib/tests.py
+25
-4
pavelib/utils/test/suites/i18n_suite.py
+3
-1
pavelib/utils/test/suites/nose_suite.py
+6
-3
pavelib/utils/test/suites/suite.py
+10
-0
No files found.
pavelib/tests.py
View file @
4221bf9e
...
@@ -6,6 +6,7 @@ import sys
...
@@ -6,6 +6,7 @@ import sys
from
paver.easy
import
sh
,
task
,
cmdopts
,
needs
from
paver.easy
import
sh
,
task
,
cmdopts
,
needs
from
pavelib.utils.test
import
suites
from
pavelib.utils.test
import
suites
from
pavelib.utils.envs
import
Env
from
pavelib.utils.envs
import
Env
from
optparse
import
make_option
try
:
try
:
from
pygments.console
import
colorize
from
pygments.console
import
colorize
...
@@ -25,7 +26,10 @@ __test__ = False # do not collect
...
@@ -25,7 +26,10 @@ __test__ = False # do not collect
(
"test_id="
,
"t"
,
"Test id"
),
(
"test_id="
,
"t"
,
"Test id"
),
(
"failed"
,
"f"
,
"Run only failed tests"
),
(
"failed"
,
"f"
,
"Run only failed tests"
),
(
"fail_fast"
,
"x"
,
"Run only failed tests"
),
(
"fail_fast"
,
"x"
,
"Run only failed tests"
),
(
"fasttest"
,
"a"
,
"Run without collectstatic"
)
(
"fasttest"
,
"a"
,
"Run without collectstatic"
),
make_option
(
"--verbose"
,
action
=
"store_const"
,
const
=
2
,
dest
=
"verbosity"
),
make_option
(
"-q"
,
"--quiet"
,
action
=
"store_const"
,
const
=
0
,
dest
=
"verbosity"
),
make_option
(
"-v"
,
"--verbosity"
,
action
=
"count"
,
dest
=
"verbosity"
,
default
=
1
),
])
])
def
test_system
(
options
):
def
test_system
(
options
):
"""
"""
...
@@ -38,6 +42,7 @@ def test_system(options):
...
@@ -38,6 +42,7 @@ def test_system(options):
'failed_only'
:
getattr
(
options
,
'failed'
,
None
),
'failed_only'
:
getattr
(
options
,
'failed'
,
None
),
'fail_fast'
:
getattr
(
options
,
'fail_fast'
,
None
),
'fail_fast'
:
getattr
(
options
,
'fail_fast'
,
None
),
'fasttest'
:
getattr
(
options
,
'fasttest'
,
None
),
'fasttest'
:
getattr
(
options
,
'fasttest'
,
None
),
'verbosity'
:
getattr
(
options
,
'verbosity'
,
1
),
}
}
if
test_id
:
if
test_id
:
...
@@ -66,6 +71,9 @@ def test_system(options):
...
@@ -66,6 +71,9 @@ def test_system(options):
(
"test_id="
,
"t"
,
"Test id"
),
(
"test_id="
,
"t"
,
"Test id"
),
(
"failed"
,
"f"
,
"Run only failed tests"
),
(
"failed"
,
"f"
,
"Run only failed tests"
),
(
"fail_fast"
,
"x"
,
"Run only failed tests"
),
(
"fail_fast"
,
"x"
,
"Run only failed tests"
),
make_option
(
"--verbose"
,
action
=
"store_const"
,
const
=
2
,
dest
=
"verbosity"
),
make_option
(
"-q"
,
"--quiet"
,
action
=
"store_const"
,
const
=
0
,
dest
=
"verbosity"
),
make_option
(
"-v"
,
"--verbosity"
,
action
=
"count"
,
dest
=
"verbosity"
,
default
=
1
),
])
])
def
test_lib
(
options
):
def
test_lib
(
options
):
"""
"""
...
@@ -77,6 +85,7 @@ def test_lib(options):
...
@@ -77,6 +85,7 @@ def test_lib(options):
opts
=
{
opts
=
{
'failed_only'
:
getattr
(
options
,
'failed'
,
None
),
'failed_only'
:
getattr
(
options
,
'failed'
,
None
),
'fail_fast'
:
getattr
(
options
,
'fail_fast'
,
None
),
'fail_fast'
:
getattr
(
options
,
'fail_fast'
,
None
),
'verbosity'
:
getattr
(
options
,
'verbosity'
,
1
),
}
}
if
test_id
:
if
test_id
:
...
@@ -98,6 +107,9 @@ def test_lib(options):
...
@@ -98,6 +107,9 @@ def test_lib(options):
@cmdopts
([
@cmdopts
([
(
"failed"
,
"f"
,
"Run only failed tests"
),
(
"failed"
,
"f"
,
"Run only failed tests"
),
(
"fail_fast"
,
"x"
,
"Run only failed tests"
),
(
"fail_fast"
,
"x"
,
"Run only failed tests"
),
make_option
(
"--verbose"
,
action
=
"store_const"
,
const
=
2
,
dest
=
"verbosity"
),
make_option
(
"-q"
,
"--quiet"
,
action
=
"store_const"
,
const
=
0
,
dest
=
"verbosity"
),
make_option
(
"-v"
,
"--verbosity"
,
action
=
"count"
,
dest
=
"verbosity"
,
default
=
1
),
])
])
def
test_python
(
options
):
def
test_python
(
options
):
"""
"""
...
@@ -106,6 +118,7 @@ def test_python(options):
...
@@ -106,6 +118,7 @@ def test_python(options):
opts
=
{
opts
=
{
'failed_only'
:
getattr
(
options
,
'failed'
,
None
),
'failed_only'
:
getattr
(
options
,
'failed'
,
None
),
'fail_fast'
:
getattr
(
options
,
'fail_fast'
,
None
),
'fail_fast'
:
getattr
(
options
,
'fail_fast'
,
None
),
'verbosity'
:
getattr
(
options
,
'verbosity'
,
1
),
}
}
python_suite
=
suites
.
PythonTestSuite
(
'Python Tests'
,
**
opts
)
python_suite
=
suites
.
PythonTestSuite
(
'Python Tests'
,
**
opts
)
...
@@ -130,13 +143,21 @@ def test_i18n():
...
@@ -130,13 +143,21 @@ def test_i18n():
'pavelib.prereqs.install_prereqs'
,
'pavelib.prereqs.install_prereqs'
,
'pavelib.utils.test.utils.clean_reports_dir'
,
'pavelib.utils.test.utils.clean_reports_dir'
,
)
)
def
test
():
@cmdopts
([
make_option
(
"--verbose"
,
action
=
"store_const"
,
const
=
2
,
dest
=
"verbosity"
),
make_option
(
"-q"
,
"--quiet"
,
action
=
"store_const"
,
const
=
0
,
dest
=
"verbosity"
),
make_option
(
"-v"
,
"--verbosity"
,
action
=
"count"
,
dest
=
"verbosity"
,
default
=
1
),
])
def
test
(
options
):
"""
"""
Run all tests
Run all tests
"""
"""
opts
=
{
'verbosity'
:
getattr
(
options
,
'verbosity'
,
1
)
}
# Subsuites to be added to the main suite
# Subsuites to be added to the main suite
python_suite
=
suites
.
PythonTestSuite
(
'Python Tests'
)
python_suite
=
suites
.
PythonTestSuite
(
'Python Tests'
,
**
opts
)
i18n_suite
=
suites
.
I18nTestSuite
(
'i18n'
)
i18n_suite
=
suites
.
I18nTestSuite
(
'i18n'
,
**
opts
)
js_suite
=
suites
.
JsTestSuite
(
'JS Tests'
,
mode
=
'run'
,
with_coverage
=
True
)
js_suite
=
suites
.
JsTestSuite
(
'JS Tests'
,
mode
=
'run'
,
with_coverage
=
True
)
# Main suite to be run
# Main suite to be run
...
...
pavelib/utils/test/suites/i18n_suite.py
View file @
4221bf9e
...
@@ -30,10 +30,12 @@ class I18nTestSuite(TestSuite):
...
@@ -30,10 +30,12 @@ class I18nTestSuite(TestSuite):
cmd
=
(
cmd
=
(
"{pythonpath_prefix} nosetests {repo_root}/i18n/tests "
"{pythonpath_prefix} nosetests {repo_root}/i18n/tests "
"--with-xunit --xunit-file={xunit_report}"
.
format
(
"--with-xunit --xunit-file={xunit_report} "
"--verbosity={verbosity}.format(
pythonpath_prefix=pythonpath_prefix,
pythonpath_prefix=pythonpath_prefix,
repo_root=Env.REPO_ROOT,
repo_root=Env.REPO_ROOT,
xunit_report=self.xunit_report,
xunit_report=self.xunit_report,
verbosity=self.verbosity,
)
)
)
)
...
...
pavelib/utils/test/suites/nose_suite.py
View file @
4221bf9e
...
@@ -110,9 +110,10 @@ class SystemTestSuite(NoseTestSuite):
...
@@ -110,9 +110,10 @@ class SystemTestSuite(NoseTestSuite):
@property
@property
def
cmd
(
self
):
def
cmd
(
self
):
cmd
=
(
cmd
=
(
'./manage.py {system} test
{test_id} {test_opts
} '
'./manage.py {system} test
--verbosity={verbosity
} '
'--traceback --settings=test'
.
format
(
'
{test_id} {test_opts}
--traceback --settings=test'
.
format
(
system
=
self
.
root
,
system
=
self
.
root
,
verbosity
=
self
.
verbosity
,
test_id
=
self
.
test_id
,
test_id
=
self
.
test_id
,
test_opts
=
self
.
test_options_flags
,
test_opts
=
self
.
test_options_flags
,
)
)
...
@@ -158,11 +159,13 @@ class LibTestSuite(NoseTestSuite):
...
@@ -158,11 +159,13 @@ class LibTestSuite(NoseTestSuite):
def
cmd
(
self
):
def
cmd
(
self
):
cmd
=
(
cmd
=
(
"nosetests --id-file={test_ids} {test_id} {test_opts} "
"nosetests --id-file={test_ids} {test_id} {test_opts} "
"--with-xunit --xunit-file={xunit_report}"
.
format
(
"--with-xunit --xunit-file={xunit_report} "
"--verbosity={verbosity}"
.
format
(
test_ids
=
self
.
test_ids
,
test_ids
=
self
.
test_ids
,
test_id
=
self
.
test_id
,
test_id
=
self
.
test_id
,
test_opts
=
self
.
test_options_flags
,
test_opts
=
self
.
test_options_flags
,
xunit_report
=
self
.
xunit_report
,
xunit_report
=
self
.
xunit_report
,
verbosity
=
self
.
verbosity
,
)
)
)
)
...
...
pavelib/utils/test/suites/suite.py
View file @
4221bf9e
...
@@ -21,6 +21,16 @@ class TestSuite(object):
...
@@ -21,6 +21,16 @@ class TestSuite(object):
self
.
root
=
args
[
0
]
self
.
root
=
args
[
0
]
self
.
subsuites
=
kwargs
.
get
(
'subsuites'
,
[])
self
.
subsuites
=
kwargs
.
get
(
'subsuites'
,
[])
self
.
failed_suites
=
[]
self
.
failed_suites
=
[]
self
.
verbosity
=
kwargs
.
get
(
'verbosity'
,
1
)
@property
def
verbose
(
self
):
"""
Boolean version of `self.verbosity`. If `self.verbosity` is greater than
1, `self.verbose` is True. Note that the default value for
`self.verbosity` is 1, so the default value for `self.verbose` is False.
"""
return
self
.
verbosity
>
1
def
__enter__
(
self
):
def
__enter__
(
self
):
"""
"""
...
...
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