Commit 83e2b362 by Calen Pennington

Make reports directory build work correctly

parent 0cf46f76
...@@ -38,6 +38,10 @@ def django_admin(system, env, command, *args) ...@@ -38,6 +38,10 @@ def django_admin(system, env, command, *args)
return "#{django_admin} #{command} --settings=#{system}.envs.#{env} --pythonpath=. #{args.join(' ')}" return "#{django_admin} #{command} --settings=#{system}.envs.#{env} --pythonpath=. #{args.join(' ')}"
end end
def report_dir_path(dir)
return File.join(REPORT_DIR, dir.to_s)
end
task :default => [:test, :pep8, :pylint] task :default => [:test, :pep8, :pylint]
directory REPORT_DIR directory REPORT_DIR
...@@ -58,7 +62,7 @@ task :clean_test_files do ...@@ -58,7 +62,7 @@ task :clean_test_files do
end end
[:lms, :cms, :common].each do |system| [:lms, :cms, :common].each do |system|
report_dir = File.join(REPORT_DIR, system.to_s) report_dir = report_dir_path(system)
directory report_dir directory report_dir
desc "Run pep8 on all #{system} code" desc "Run pep8 on all #{system} code"
...@@ -107,8 +111,7 @@ end ...@@ -107,8 +111,7 @@ end
TEST_TASK_DIRS = [] TEST_TASK_DIRS = []
[:lms, :cms].each do |system| [:lms, :cms].each do |system|
report_dir = File.join(REPORT_DIR, system.to_s) report_dir = report_dir_path(system)
directory report_dir
# 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}"
...@@ -154,8 +157,7 @@ end ...@@ -154,8 +157,7 @@ end
Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib| Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib|
task_name = "test_#{lib}" task_name = "test_#{lib}"
report_dir = File.join(REPORT_DIR, task_name.gsub('/', '_')) report_dir = report_dir_path(lib)
directory report_dir
desc "Run tests for common lib #{lib}" desc "Run tests for common lib #{lib}"
task task_name => report_dir do task task_name => report_dir do
...@@ -174,6 +176,14 @@ Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib| ...@@ -174,6 +176,14 @@ Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib|
end end
task :report_dirs
TEST_TASK_DIRS.each do |dir|
report_dir = report_dir_path(dir)
directory report_dir
task :report_dirs => [REPORT_DIR, report_dir]
end
task :test do task :test do
TEST_TASK_DIRS.each do |dir| TEST_TASK_DIRS.each do |dir|
Rake::Task["test_#{dir}"].invoke(false) Rake::Task["test_#{dir}"].invoke(false)
...@@ -186,14 +196,14 @@ end ...@@ -186,14 +196,14 @@ end
namespace :coverage do namespace :coverage do
desc "Build the html coverage reports" desc "Build the html coverage reports"
task :html do task :html => :report_dirs do
TEST_TASK_DIRS.each do |dir| TEST_TASK_DIRS.each do |dir|
sh("coverage html --rcfile=#{dir}/.coveragerc") sh("coverage html --rcfile=#{dir}/.coveragerc")
end end
end end
desc "Build the xml coverage reports" desc "Build the xml coverage reports"
task :xml do task :xml => :report_dirs do
TEST_TASK_DIRS.each do |dir| TEST_TASK_DIRS.each do |dir|
# Why doesn't the rcfile control the xml output file properly?? # Why doesn't the rcfile control the xml output file properly??
sh("coverage xml -o reports/#{dir}/coverage.xml --rcfile=#{dir}/.coveragerc") sh("coverage xml -o reports/#{dir}/coverage.xml --rcfile=#{dir}/.coveragerc")
......
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