Allow rake test to run individual tests again
This commit is contained in:
@@ -25,7 +25,6 @@ _report_dir = REPO_ROOT / 'reports' / _system
|
||||
_report_dir.makedirs_p()
|
||||
|
||||
NOSE_ARGS = [
|
||||
'--tests', PROJECT_ROOT / 'djangoapps', COMMON_ROOT / 'djangoapps',
|
||||
'--id-file', REPO_ROOT / '.testids' / _system / 'noseids',
|
||||
'--xunit-file', _report_dir / 'nosetests.xml',
|
||||
]
|
||||
|
||||
@@ -51,7 +51,6 @@ _report_dir = REPO_ROOT / 'reports' / _system
|
||||
_report_dir.makedirs_p()
|
||||
|
||||
NOSE_ARGS = [
|
||||
'--tests', PROJECT_ROOT / 'djangoapps', COMMON_ROOT / 'djangoapps',
|
||||
'--id-file', REPO_ROOT / '.testids' / _system / 'noseids',
|
||||
'--xunit-file', _report_dir / 'nosetests.xml',
|
||||
]
|
||||
|
||||
@@ -17,7 +17,19 @@ def run_under_coverage(cmd, root)
|
||||
end
|
||||
|
||||
def run_tests(system, report_dir, test_id=nil, stop_on_failure=true)
|
||||
test_id = '' if test_id.nil?
|
||||
|
||||
# If no test id is provided, we need to limit the test runner
|
||||
# to the Djangoapps we want to test. Otherwise, it will
|
||||
# run tests on all installed packages.
|
||||
if test_id.nil?
|
||||
test_id = "#{system}/djangoapps common/djangoapps"
|
||||
|
||||
# Handle "--failed" as a special case: we want to re-run only
|
||||
# the tests that failed within our Django apps
|
||||
elsif test_id == '--failed'
|
||||
test_id = "#{system}/djangoapps common/djangoapps --failed"
|
||||
end
|
||||
|
||||
cmd = django_admin(system, :test, 'test', test_id)
|
||||
test_sh(run_under_coverage(cmd, system))
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user