From 4bf9323eedd06528e052e23d06ff1b4fcace0a31 Mon Sep 17 00:00:00 2001 From: Victor Shnayder Date: Mon, 15 Oct 2012 02:23:00 -0400 Subject: [PATCH] More test speedups: - Add tasks to test lib without coverage - Add a coverage flag to test.py (set to True, for manual tweaking for now) --- lms/envs/test.py | 18 ++++++++++++------ rakefile | 7 +++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/lms/envs/test.py b/lms/envs/test.py index c899fd8562..bad680077b 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -27,12 +27,18 @@ SOUTH_TESTS_MIGRATE = False # To disable migrations and use syncdb instead # Nose Test Runner INSTALLED_APPS += ('django_nose',) -NOSE_ARGS = ['--cover-erase', '--with-xunit', '--with-xcoverage', '--cover-html', - # '-v', '--pdb', # When really stuck, uncomment to start debugger on error - '--cover-inclusive', '--cover-html-dir', - os.environ.get('NOSE_COVER_HTML_DIR', 'cover_html')] -for app in os.listdir(PROJECT_ROOT / 'djangoapps'): - NOSE_ARGS += ['--cover-package', app] +NOSE_ARGS = [] + +# Turning off coverage speeds up tests dramatically... until we have better config, +# leave it here for manual fiddling. +_coverage = True +if _coverage: + NOSE_ARGS = ['--cover-erase', '--with-xunit', '--with-xcoverage', '--cover-html', + # '-v', '--pdb', # When really stuck, uncomment to start debugger on error + '--cover-inclusive', '--cover-html-dir', + os.environ.get('NOSE_COVER_HTML_DIR', 'cover_html')] + for app in os.listdir(PROJECT_ROOT / 'djangoapps'): + NOSE_ARGS += ['--cover-package', app] TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' # Local Directories diff --git a/rakefile b/rakefile index 91c3a6dd2a..90cd5fe87f 100644 --- a/rakefile +++ b/rakefile @@ -151,6 +151,13 @@ Dir["common/lib/*"].each do |lib| sh("nosetests #{lib} --cover-erase --with-xunit --with-xcoverage --cover-html --cover-inclusive --cover-package #{File.basename(lib)} --cover-html-dir #{File.join(report_dir, "cover")}") end TEST_TASKS << task_name + + desc "Run tests for common lib #{lib} (without coverage)" + task "fasttest_#{lib}" do + sh("nosetests #{lib}") + end + + end task :test do