Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update makefile and test runner for CI

  • Loading branch information...
commit 4a9f0019c885e2f6444bab08b016ebeea2ac37cb 1 parent 5316b75
@codeinthehole codeinthehole authored
Showing with 24 additions and 4 deletions.
  1. +11 −0 Makefile
  2. +13 −4 runtests.py
View
11 Makefile
@@ -1,3 +1,6 @@
+# These targets are not files
+.PHONY: contribute ci test i18n
+
contribute:
# Create a sandbox installation for playing around with oscar.
python setup.py develop
@@ -10,6 +13,14 @@ contribute:
sandbox/manage.py oscar_import_catalogue_images sandbox/data/books-images.tar.gz
sandbox/manage.py loaddata countries.json sandbox/fixtures/pages.json
+ci:
+ # Run continous tests and generate lint reports
+ python setup.py develop
+ pip install -r requirements.txt
+ #./runtests.py --with-coverage
+ pyflakes oscar | perl -ple "s/: /: [E] /" | grep -v migrations > violations.txt
+ pep8 --exclude="migrations" oscar | perl -ple 's/: [WE](\d+)/: [W$1]/' > violations.txt
+
test:
./runtests.py
View
17 runtests.py
@@ -20,14 +20,23 @@ def run_tests(*test_args):
if __name__ == '__main__':
parser = OptionParser()
- __, args = parser.parse_args()
+ parser.add_option('--with-coverage', dest='coverage', default=False,
+ action='store_true')
+ parser.add_option('--with-xunit', dest='xunit', default=False,
+ action='store_true')
+ options, args = parser.parse_args()
# If no args, then use 'progressive' plugin to keep the screen real estate
# used down to a minimum. Otherwise, use the spec plugin
nose_args = ['-s', '-x',
'--with-progressive' if not args else '--with-spec']
- #nose_args.extend([
- # '--with-coverage', '--cover-package=oscar', '--cover-html',
- # '--cover-html-dir=htmlcov'])
+
+ if options.coverage:
+ # Nose automatically uses any options passed to runtests.py, which is
+ # why the coverage trigger uses '--with-coverage' and why we don't need
+ # to explicitly include it here.
+ nose_args.extend([
+ '--cover-package=oscar', '--cover-html',
+ '--cover-html-dir=htmlcov'])
configure(nose_args)
run_tests(*args)
Please sign in to comment.
Something went wrong with that request. Please try again.