Commit d4df9eeb by Calen Pennington

Merge pull request #1866 from MITx/feature/cale/enable-rednose

Enable test colors in nosetests
parents 9fff26cf 73f5dc1c
......@@ -13,7 +13,6 @@ from path import path
# Nose Test Runner
INSTALLED_APPS += ('django_nose',)
NOSE_ARGS = ['--with-xunit']
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
TEST_ROOT = path('test_root')
......
......@@ -67,7 +67,7 @@ If if you aren't changing static files, can run `rake test` once, then run
or
rake fasttest_cms
xmodule can be tested independently, with this:
rake test_common/lib/xmodule
......@@ -90,7 +90,7 @@ To run a single nose test:
nosetests common/lib/xmodule/xmodule/tests/test_stringify.py:test_stringify
Very handy: if you uncomment the `--pdb` argument in `NOSE_ARGS` in `lms/envs/test.py`, it will drop you into pdb on error. This lets you go up and down the stack and see what the values of the variables are. Check out http://docs.python.org/library/pdb.html
Very handy: if you uncomment the `pdb=1` line in `setup.cfg`, it will drop you into pdb on error. This lets you go up and down the stack and see what the values of the variables are. Check out http://docs.python.org/library/pdb.html
### Javascript Tests
......@@ -105,7 +105,7 @@ To run the tests headless, you must install phantomjs (http://phantomjs.org/down
rake phantomjs_jasmine_{lms,cms}
If the `phantomjs` binary is not on the path, set the `PHANTOMJS_PATH` environment variable to point to it
PHANTOMJS_PATH=/path/to/phantomjs rake phantomjs_jasmine_{lms,cms}
......@@ -126,7 +126,7 @@ When you connect to the LMS, you need to use the public ip. Use `ifconfig` to f
## Content development
If you change course content, while running the LMS in dev mode, it is unnecessary to restart to refresh the modulestore.
If you change course content, while running the LMS in dev mode, it is unnecessary to restart to refresh the modulestore.
Instead, hit /migrate/modules to see a list of all modules loaded, and click on links (eg /migrate/reload/edx4edx) to reload a course.
......
......@@ -27,10 +27,6 @@ SOUTH_TESTS_MIGRATE = False # To disable migrations and use syncdb instead
# Nose Test Runner
INSTALLED_APPS += ('django_nose',)
NOSE_ARGS = [
'--with-xunit',
# '-v', '--pdb', # When really stuck, uncomment to start debugger on error
]
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
# Local Directories
......
......@@ -48,10 +48,11 @@ def django_for_jasmine(system, django_reload)
reload_arg = '--noreload'
end
port = 10000 + rand(40000)
django_pid = fork do
exec(*django_admin(system, 'jasmine', 'runserver', '-v', '0', "12345", reload_arg).split(' '))
exec(*django_admin(system, 'jasmine', 'runserver', '-v', '0', port.to_s, reload_arg).split(' '))
end
jasmine_url = 'http://localhost:12345/_jasmine/'
jasmine_url = "http://localhost:#{port}/_jasmine/"
up = false
start_time = Time.now
until up do
......@@ -269,7 +270,7 @@ Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib|
desc "Run tests for common lib #{lib}"
task task_name => report_dir do
ENV['NOSE_XUNIT_FILE'] = File.join(report_dir, "nosetests.xml")
cmd = "nosetests #{lib} --logging-clear-handlers --with-xunit"
cmd = "nosetests #{lib}"
sh(run_under_coverage(cmd, lib)) do |ok, res|
$failed_tests += 1 unless ok
end
......
[nosetests]
logging-clear-handlers=1
with-xunit=1
rednose=1
# Uncomment the following line to open pdb when a test fails
#pdb=1
\ No newline at end of file
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