Skip to content
This repository
Browse code

Update makefile and test runner for CI

  • Loading branch information...
commit 4a9f0019c885e2f6444bab08b016ebeea2ac37cb 1 parent 5316b75
David Winterbottom authored

Showing 2 changed files with 24 additions and 4 deletions. Show diff stats Hide diff stats

  1. 11  Makefile
  2. 17  runtests.py
11  Makefile
... ...
@@ -1,3 +1,6 @@
  1
+# These targets are not files
  2
+.PHONY: contribute ci test i18n
  3
+
1 4
 contribute:
2 5
 	# Create a sandbox installation for playing around with oscar.
3 6
 	python setup.py develop
@@ -10,6 +13,14 @@ contribute:
10 13
 	sandbox/manage.py oscar_import_catalogue_images sandbox/data/books-images.tar.gz
11 14
 	sandbox/manage.py loaddata countries.json sandbox/fixtures/pages.json
12 15
 
  16
+ci:
  17
+	# Run continous tests and generate lint reports
  18
+	python setup.py develop
  19
+	pip install -r requirements.txt
  20
+	#./runtests.py --with-coverage
  21
+	pyflakes oscar | perl -ple "s/: /: [E] /" | grep -v migrations > violations.txt
  22
+	pep8 --exclude="migrations" oscar | perl -ple 's/: [WE](\d+)/: [W$1]/' > violations.txt
  23
+
13 24
 test:
14 25
 	./runtests.py
15 26
 
17  runtests.py
@@ -20,14 +20,23 @@ def run_tests(*test_args):
20 20
 
21 21
 if __name__ == '__main__':
22 22
     parser = OptionParser()
23  
-    __, args = parser.parse_args()
  23
+    parser.add_option('--with-coverage', dest='coverage', default=False,
  24
+                      action='store_true')
  25
+    parser.add_option('--with-xunit', dest='xunit', default=False,
  26
+                      action='store_true')
  27
+    options, args = parser.parse_args()
24 28
 
25 29
     # If no args, then use 'progressive' plugin to keep the screen real estate
26 30
     # used down to a minimum.  Otherwise, use the spec plugin
27 31
     nose_args = ['-s', '-x',
28 32
                  '--with-progressive' if not args else '--with-spec']
29  
-    #nose_args.extend([
30  
-    #    '--with-coverage', '--cover-package=oscar', '--cover-html',
31  
-    #    '--cover-html-dir=htmlcov'])
  33
+
  34
+    if options.coverage:
  35
+        # Nose automatically uses any options passed to runtests.py, which is
  36
+        # why the coverage trigger uses '--with-coverage' and why we don't need
  37
+        # to explicitly include it here.
  38
+        nose_args.extend([
  39
+            '--cover-package=oscar', '--cover-html',
  40
+            '--cover-html-dir=htmlcov'])
32 41
     configure(nose_args)
33 42
     run_tests(*args)

0 notes on commit 4a9f001

Please sign in to comment.
Something went wrong with that request. Please try again.