add fasttest rake command

* test_{cms/lms} will run collectstatic first, fasttest_{cms/lms} won't
* also add staticfiles dir to test_root gitignore
This commit is contained in:
Victor Shnayder
2012-07-13 12:07:42 -04:00
parent 339e9a68f4
commit 1f1fab4992
2 changed files with 16 additions and 3 deletions

View File

@@ -74,6 +74,14 @@ end
task :pylint => "pylint_#{system}"
end
def run_tests(system, report_dir)
ENV['NOSE_XUNIT_FILE'] = File.join(report_dir, "nosetests.xml")
ENV['NOSE_COVER_HTML_DIR'] = File.join(report_dir, "cover")
sh(django_admin(system, :test, 'test', *Dir["#{system}/djangoapps/*"].each))
end
[:lms, :cms].each do |system|
report_dir = File.join(REPORT_DIR, system.to_s)
directory report_dir
@@ -81,10 +89,14 @@ end
# Per System tasks
desc "Run all django tests on our djangoapps for the #{system}"
task "test_#{system}" => [report_dir, :predjango, "#{system}:collectstatic:test"] do
ENV['NOSE_XUNIT_FILE'] = File.join(report_dir, "nosetests.xml")
ENV['NOSE_COVER_HTML_DIR'] = File.join(report_dir, "cover")
sh(django_admin(system, :test, 'test', *Dir["#{system}/djangoapps/*"].each))
run_tests(system, report_dir)
end
# Have a way to run the tests without running collectstatic -- useful when debugging without
# messing with static files.
task "fasttest_#{system}" => [report_dir, :predjango] do
run_tests(system, report_dir)
end
task :test => "test_#{system}"
desc <<-desc

View File

@@ -1,2 +1,3 @@
local_repo
remote_repo
staticfiles