Commit 1f1fab49 by Victor Shnayder

add fasttest rake command

* test_{cms/lms} will run collectstatic first, fasttest_{cms/lms} won't
* also add staticfiles dir to test_root gitignore
parent 339e9a68
...@@ -74,6 +74,14 @@ end ...@@ -74,6 +74,14 @@ end
task :pylint => "pylint_#{system}" task :pylint => "pylint_#{system}"
end 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| [:lms, :cms].each do |system|
report_dir = File.join(REPORT_DIR, system.to_s) report_dir = File.join(REPORT_DIR, system.to_s)
directory report_dir directory report_dir
...@@ -81,10 +89,14 @@ end ...@@ -81,10 +89,14 @@ end
# Per System tasks # Per System tasks
desc "Run all django tests on our djangoapps for the #{system}" desc "Run all django tests on our djangoapps for the #{system}"
task "test_#{system}" => [report_dir, :predjango, "#{system}:collectstatic:test"] do task "test_#{system}" => [report_dir, :predjango, "#{system}:collectstatic:test"] do
ENV['NOSE_XUNIT_FILE'] = File.join(report_dir, "nosetests.xml") run_tests(system, report_dir)
ENV['NOSE_COVER_HTML_DIR'] = File.join(report_dir, "cover") end
sh(django_admin(system, :test, 'test', *Dir["#{system}/djangoapps/*"].each)) # 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 end
task :test => "test_#{system}" task :test => "test_#{system}"
desc <<-desc desc <<-desc
......
local_repo local_repo
remote_repo remote_repo
staticfiles
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