Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cms/envs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
# Nose Test Runner
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')

# Want static files in the same dir for running on jenkins.
Expand Down
13 changes: 13 additions & 0 deletions lms/envs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from path import path
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 test everything else :)
MITX_FEATURES['DISABLE_START_DATES'] = True
Expand All @@ -43,6 +45,17 @@
# Nose Test Runner
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',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we test 'lms/djangoapps', why not just 'lms' ? There are no tests in lms outside of lms/djangoapps, but there is code outside of djangoapps, shouldn't we be prepared for it to grow tests one day?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No real reason, initially, but upon trying it out w/o, it turns out it doesn't work. And the reason it doesn't is that djangoapps doesn't have an __init__.py.

'--id-file', REPO_ROOT / '.testids' / _system / 'noseids',
'--xunit-file', _report_dir / 'nosetests.xml',
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code set --logging-clear-handlers, this code does not. On purpose?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging-clear-handlers was already being set in setup.cfg, so passing it as an argument was redundant.


# Local Directories
TEST_ROOT = path("test_root")
# Want static files in the same dir for running on jenkins.
Expand Down
12 changes: 2 additions & 10 deletions rakelib/tests.rake
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,8 @@ def run_under_coverage(cmd, root)
end

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_file = File.join(test_id_dir(system), "noseids")
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_id = '' if test_id.nil?
cmd = django_admin(system, :test, 'test', test_id)
test_sh(run_under_coverage(cmd, system))
end

Expand Down