Commit 800ed264 by Calen Pennington

Make it possible to run cleanliness stuff on lms

parent a37c8738
...@@ -5,6 +5,7 @@ require 'tempfile' ...@@ -5,6 +5,7 @@ require 'tempfile'
REPO_ROOT = File.dirname(__FILE__) REPO_ROOT = File.dirname(__FILE__)
BUILD_DIR = File.join(REPO_ROOT, "build") BUILD_DIR = File.join(REPO_ROOT, "build")
REPORT_DIR = File.join(REPO_ROOT, "reports") REPORT_DIR = File.join(REPO_ROOT, "reports")
LMS_REPORT_DIR = File.join(REPORT_DIR, "lms")
# Packaging constants # Packaging constants
DEPLOY_DIR = "/opt/wwc" DEPLOY_DIR = "/opt/wwc"
...@@ -37,26 +38,27 @@ end ...@@ -37,26 +38,27 @@ end
task :default => [:pep8, :pylint, :test] task :default => [:pep8, :pylint, :test]
directory REPORT_DIR directory REPORT_DIR
directory LMS_REPORT_DIR
desc "Run pep8 on all of djangoapps" desc "Run pep8 on all of djangoapps"
task :pep8 => REPORT_DIR do task :pep8 => LMS_REPORT_DIR do
sh("pep8 --ignore=E501 djangoapps | tee #{REPORT_DIR}/pep8.report") sh("pep8 --ignore=E501 lms/djangoapps | tee #{LMS_REPORT_DIR}/pep8.report")
end end
desc "Run pylint on all of djangoapps" desc "Run pylint on all of djangoapps"
task :pylint => REPORT_DIR do task :pylint => LMS_REPORT_DIR do
Dir.chdir("djangoapps") do ENV['PYTHONPATH'] = 'lms/djangoapps'
Dir["*"].each do |app| Dir["lms/djangoapps/*"].each do |app|
sh("pylint -f parseable #{app} | tee #{REPORT_DIR}/#{app}.pylint.report") app = File.basename(app)
end sh("pylint -f parseable #{app} | tee #{LMS_REPORT_DIR}/#{app}.pylint.report")
end end
end end
desc "Run all django tests on our djangoapps" desc "Run all django tests on our djangoapps"
task :test => REPORT_DIR do task :test => LMS_REPORT_DIR do
ENV['NOSE_XUNIT_FILE'] = File.join(REPORT_DIR, "nosetests.xml") ENV['NOSE_XUNIT_FILE'] = File.join(LMS_REPORT_DIR, "nosetests.xml")
django_admin = ENV['DJANGO_ADMIN_PATH'] || select_executable('django-admin.py', 'django-admin') django_admin = ENV['DJANGO_ADMIN_PATH'] || select_executable('django-admin.py', 'django-admin')
sh("#{django_admin} test --settings=envs.test --pythonpath=. $(ls djangoapps)") sh("#{django_admin} test --settings=lms.envs.test --pythonpath=. $(ls lms/djangoapps)")
end end
desc <<-desc desc <<-desc
......
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