Commit 37627704 by Calen Pennington

Merge pull request #1117 from cpennington/manage.py-only-tests

Move nose arguments around so that we can run tests with manage.py
parents 759a8534 67ccf1e3
...@@ -20,6 +20,16 @@ from warnings import filterwarnings ...@@ -20,6 +20,16 @@ from warnings import filterwarnings
# Nose Test Runner # Nose Test Runner
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
_system = 'cms'
_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',
]
TEST_ROOT = path('test_root') TEST_ROOT = path('test_root')
# Want static files in the same dir for running on jenkins. # Want static files in the same dir for running on jenkins.
......
...@@ -17,6 +17,8 @@ import os ...@@ -17,6 +17,8 @@ import os
from path import path from path import path
from warnings import filterwarnings from warnings import filterwarnings
os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = 'localhost:8000-9000'
# can't test start dates with this True, but on the other hand, # can't test start dates with this True, but on the other hand,
# can test everything else :) # can test everything else :)
MITX_FEATURES['DISABLE_START_DATES'] = True MITX_FEATURES['DISABLE_START_DATES'] = True
...@@ -43,6 +45,17 @@ SOUTH_TESTS_MIGRATE = False # To disable migrations and use syncdb instead ...@@ -43,6 +45,17 @@ SOUTH_TESTS_MIGRATE = False # To disable migrations and use syncdb instead
# Nose Test Runner # Nose Test Runner
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
_system = 'lms'
_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',
]
# Local Directories # Local Directories
TEST_ROOT = path("test_root") TEST_ROOT = path("test_root")
# Want static files in the same dir for running on jenkins. # Want static files in the same dir for running on jenkins.
......
...@@ -17,16 +17,8 @@ def run_under_coverage(cmd, root) ...@@ -17,16 +17,8 @@ def run_under_coverage(cmd, root)
end end
def run_tests(system, report_dir, test_id=nil, stop_on_failure=true) def run_tests(system, report_dir, test_id=nil, stop_on_failure=true)
ENV['NOSE_XUNIT_FILE'] = File.join(report_dir, "nosetests.xml") test_id = '' if test_id.nil?
test_id_file = File.join(test_id_dir(system), "noseids") cmd = django_admin(system, :test, 'test', test_id)
dirs = Dir["common/djangoapps/*"] + Dir["#{system}/djangoapps/*"]
test_id = dirs.join(' ') if test_id.nil? or test_id == ''
cmd = django_admin(
system, :test, 'test',
'--logging-clear-handlers',
'--liveserver=localhost:8000-9000',
"--id-file=#{test_id_file}",
test_id)
test_sh(run_under_coverage(cmd, system)) test_sh(run_under_coverage(cmd, system))
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment