Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 395 lines (336 sloc) 15.889 kB
9819c0c @timlinux Selectively port work from safe_refactor
timlinux authored
1 #/***************************************************************************
3d2b7fb @uniomni Added pep8 to make test and peppified more modules
uniomni authored
2 #
16195af @timlinux Replace RIAB and InaSafe with InaSAFE
timlinux authored
3 # InaSAFE Disaster risk assessment tool developed by AusAid and World Bank
b6d7663 @timlinux Initial plugin stub
timlinux authored
4 # -------------------
5 # begin : 2012-01-09
6 # copyright : (C) 2012 by Australia Indonesia Facility for Disaster Reduction
7 # email : ole.moller.nielsen@gmail.com
8 # ***************************************************************************/
3d2b7fb @uniomni Added pep8 to make test and peppified more modules
uniomni authored
9 #
b6d7663 @timlinux Initial plugin stub
timlinux authored
10 #/***************************************************************************
11 # * *
12 # * This program is free software; you can redistribute it and/or modify *
13 # * it under the terms of the GNU General Public License as published by *
14 # * the Free Software Foundation; either version 2 of the License, or *
15 # * (at your option) any later version. *
16 # * *
17 # ***************************************************************************/
18
d3f3135 @timlinux Untrampled top level make file
timlinux authored
19 # Makefile for InaSAFE - QGIS
36a77fa @mbernasocchi Added error reporting in case off git checkout errors in update_test_…
mbernasocchi authored
20 SHELL := /bin/bash
7abc7d3 @ingenieroariel NONGUI in Makefiles now refers to safe
ingenieroariel authored
21 NONGUI := safe
d3f3135 @timlinux Untrampled top level make file
timlinux authored
22 GUI := gui
23 ALL := $(NONGUI) $(GUI) # Would like to turn this into comma separated list using e.g. $(subst,...) or $(ALL, Wstr) but None of that works as described in the various posts
18c84da @uniomni Played with the Makefile
uniomni authored
24
d3f3135 @timlinux Untrampled top level make file
timlinux authored
25 # LOCALES = space delimited list of iso codes to generate po files for
ba43ba9 @timlinux Tanslation system updates
timlinux authored
26 # Please dont remove en here
5735765 @mach0 updates for french language
mach0 authored
27 LOCALES = en id fr
5e3f036 @timlinux Cleanups to makefile to make string collection more efficient
timlinux authored
28
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
29 default: quicktest
d12f41d @uniomni Ole is a ID10T
uniomni authored
30
a720aa7 @timlinux Completed IS namespace removal. All gui tests pass
timlinux authored
31 #Qt .ts file updates - run to register new strings for translation in safe_qgis
8e6f245 @ismailsunni [Safe Refactor] Update scripts and Makefile.
ismailsunni authored
32 update-translation-strings:
ba43ba9 @timlinux Tanslation system updates
timlinux authored
33 #update application strings
1095366 @ismailsunni Update Makefile to make update-translation-strings idempotent per #180.
ismailsunni authored
34 @echo "Checking current translation."
35 @scripts/update-strings.sh $(LOCALES)
d3f3135 @timlinux Untrampled top level make file
timlinux authored
36
a720aa7 @timlinux Completed IS namespace removal. All gui tests pass
timlinux authored
37 #Qt .qm file updates - run to create binary representation of translated strings for translation in safe_qgis
9819c0c @timlinux Selectively port work from safe_refactor
timlinux authored
38 compile-translation-strings:
d3f3135 @timlinux Untrampled top level make file
timlinux authored
39 @#Compile qt messages binary
9819c0c @timlinux Selectively port work from safe_refactor
timlinux authored
40 @scripts/create_pro_file.sh
41 @lrelease-qt4 inasafe.pro
42 @rm inasafe.pro
d3f3135 @timlinux Untrampled top level make file
timlinux authored
43
b13f0e4 @uniomni Added translation statistics for gettext (still need to do qt transla…
uniomni authored
44 test-translations:
45 @echo
53f004e @uniomni More info in Makefile
uniomni authored
46 @echo "----------------------------------------------------------------"
47 @echo "Missing translations - for more info run: make translation-stats"
48 @echo "----------------------------------------------------------------"
8939663 @uniomni Played with test of translation completeness
uniomni authored
49 @python scripts/missing_translations.py `pwd` id
50
51 translation-stats:
52 @echo
b13f0e4 @uniomni Added translation statistics for gettext (still need to do qt transla…
uniomni authored
53 @echo "----------------------"
cadb8c7 @ismailsunni Translation and edit makefile.
ismailsunni authored
54 @echo "Translation statistics - for more info see http://inasafe.org/developer-docs/i18n.html"
b13f0e4 @uniomni Added translation statistics for gettext (still need to do qt transla…
uniomni authored
55 @echo "----------------------"
56 @echo
fcdbd35 @timlinux Improved reporting closes #177
timlinux authored
57 @echo "Qt translations (*.ts):"
58 @echo "----------------------------"
59 @scripts/string-stats.sh
b13f0e4 @uniomni Added translation statistics for gettext (still need to do qt transla…
uniomni authored
60
a243a1f @timlinux Added lines of code metric to Makefile - needs apt-get install sloccount
timlinux authored
61 lines-of-code:
62 @echo "----------------------"
63 @echo " Lines of code analysis"
64 @echo " Generated using David A. Wheeler's 'SLOCCount'"
65 @echo "----------------------"
c940b57 @uniomni Added sha and timestamp to lines-of-code
uniomni authored
66 @git log | head -3
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
67 @sloccount safe realtime | grep '^[0-9]'
a243a1f @timlinux Added lines of code metric to Makefile - needs apt-get install sloccount
timlinux authored
68
5d6cb83 @timlinux Added make tag target to makefile.
timlinux authored
69 changelog:
70 @echo "----------------------"
71 @echo "Generate changelog and append it to CHANGELOG"
72 @echo "----------------------"
12637dc @timlinux Added make changelog target to makefile.
timlinux authored
73 @read -p "Version e.g. 1.0.0: " VERSION; \
74 scripts/update-changelog.sh $$VERSION
5d6cb83 @timlinux Added make tag target to makefile.
timlinux authored
75
76 tag:
77 @echo
78 @echo "------------------------------------"
79 @echo "Tagging the release."
80 @echo "------------------------------------"
81 @# Note that make runs commands in a subshell so
82 @# variable context is lost from one line to the next
83 @# So we need to do everything as a single line command
84 @read -p "Version e.g. 1.0.0: " VERSION; \
85 scripts/tag-release.sh $$VERSION
86
87
d3f3135 @timlinux Untrampled top level make file
timlinux authored
88 clean:
89 @# FIXME (Ole): Use normal Makefile rules instead
90 @# Preceding dash means that make will continue in case of errors
91 @# Swapping stdout & stderr and filter out low level QGIS garbage
92 @# See http://stackoverflow.com/questions/3618078/pipe-only-stderr-through-a-filter
93 @-find . -name '*~' -exec rm {} \;
94 @-find . -name '*.pyc' -exec rm {} \;
95 @-find . -name '*.pyo' -exec rm {} \;
fb65487 @timlinux Better checking for unwanted dependencies
timlinux authored
96 @# Clean stray merge working files from git
97 @-find . -name '*.orig' -exec rm {} \;
d3f3135 @timlinux Untrampled top level make file
timlinux authored
98 @-/bin/rm .noseids 2>/dev/null || true
99 @-/bin/rm .coverage 2>/dev/null || true
9819c0c @timlinux Selectively port work from safe_refactor
timlinux authored
100
b4f1a43 @uniomni Switched to nosetests in Makefile
uniomni authored
101
18e3a26 @timlinux Resolved merge conflicts post merge from master
timlinux authored
102 # Run the test suite followed by style checking
7a9da82 @akbargumbira Update hash test data.
akbargumbira authored
103 test: clean pep8 pylint dependency_test unwanted_strings run_data_audit testdata_errorcheck test-translations test_suite
d3f3135 @timlinux Untrampled top level make file
timlinux authored
104
105 # Run the test suite for gui only
7a9da82 @akbargumbira Update hash test data.
akbargumbira authored
106 guitest: pep8 disabled_tests dependency_test unwanted_strings testdata_errorcheck gui_test_suite
f66ac60 @timlinux Added docs on embedding git revision in modules and added docs on how…
timlinux authored
107
5b1ab87 @timlinux Makefile improvments so we can run all tests against QGIS 2.x
timlinux authored
108 # Run the test suite followed by style checking includes realtime and requires QGIS 2.0
7a9da82 @akbargumbira Update hash test data.
akbargumbira authored
109 qgis2test: clean pep8 pylint dependency_test unwanted_strings run_data_audit testdata_errorcheck test-translations qgis2_test_suite
5b1ab87 @timlinux Makefile improvments so we can run all tests against QGIS 2.x
timlinux authored
110
7a9da82 @akbargumbira Update hash test data.
akbargumbira authored
111 quicktest: pep8 pylint dependency_test unwanted_strings run_data_audit test-translations test_suite_quick
c0ee40e @uniomni Added quality measures to quicktest
uniomni authored
112
113 test_suite_quick:
af7d3c3 @ismailsunni [Safe refactor, hack code to make it aware.]
ismailsunni authored
114 @-export PYTHONPATH=`pwd`:$(PYTHONPATH); nosetests -A 'not slow' -v safe --with-id
4795f10 @ingenieroariel Added quicktest make target
ingenieroariel authored
115
d3f3135 @timlinux Untrampled top level make file
timlinux authored
116 # Run pep8 style checking
de4461f @mbernasocchi added ignore pep E121-E128 (line continuation stuff)
mbernasocchi authored
117 #http://pypi.python.org/pypi/pep8
d3f3135 @timlinux Untrampled top level make file
timlinux authored
118 pep8:
130d1e1 @uniomni Resolved conflicts
uniomni authored
119 @echo
120 @echo "-----------"
121 @echo "PEP8 issues"
122 @echo "-----------"
b859f6a @timlinux Print versions of pylint and pep8 in travis and jenkins to make it ea…
timlinux authored
123 @pep8 --version
cefefc6 @timlinux Pylint and pep8 fixes for pylint 1.4.1 and pep8 1.6.1
timlinux authored
124 @pep8 --repeat --ignore=E203,E121,E122,E123,E124,E125,E126,E127,E128,E402 --exclude venv,pydev,safe_extras,keywords_dialog_base.py,wizard_dialog_base.py,dock_base.py,options_dialog_base.py,minimum_needs_configuration.py,resources_rc.py,help_base.py,xml_tools.py,system_tools.py,data_audit.py,data_audit_wrapper.py . || true
d3f3135 @timlinux Untrampled top level make file
timlinux authored
125
571a428 @timlinux Realtime merging to master
timlinux authored
126 # Run entire test suite - excludes realtime until we have QGIS 2.0 support
11e5ce1 @ismailsunni [Makefile] Remove compile.
ismailsunni authored
127 test_suite: testdata
d3f3135 @timlinux Untrampled top level make file
timlinux authored
128 @echo
5951e18 @uniomni Poodle fluffing
uniomni authored
129 @echo "---------------------"
36a77fa @mbernasocchi Added error reporting in case off git checkout errors in update_test_…
mbernasocchi authored
130 @echo "Regression Test Suite"
5951e18 @uniomni Poodle fluffing
uniomni authored
131 @echo "---------------------"
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
132 @-export PYTHONPATH=`pwd`:$(PYTHONPATH);export QGIS_DEBUG=0;export QGIS_LOG_FILE=/dev/null;export QGIS_DEBUG_FILE=/dev/null;nosetests -v --with-id --with-coverage --cover-package=safe safe 3>&1 1>&2 2>&3 3>&- || true
d3f3135 @timlinux Untrampled top level make file
timlinux authored
133
134 @# Report expected failures if any!
135 @#echo Expecting 1 test to fail in support of issue #3
893124b @timlinux Annotated test suite to indicate that fail of #160 is expected
timlinux authored
136 @#echo Expecting 1 test to fail in support of issue #160
d3f3135 @timlinux Untrampled top level make file
timlinux authored
137
ec1bbd3 @timlinux Makefile cleanups: remove doc gen targets and added target to run saf…
timlinux authored
138 # Run safe package tests only
11e5ce1 @ismailsunni [Makefile] Remove compile.
ismailsunni authored
139 safe_test_suite: testdata
ec1bbd3 @timlinux Makefile cleanups: remove doc gen targets and added target to run saf…
timlinux authored
140 @echo
141 @echo "---------------------"
142 @echo "Safe Regression Test Suite"
143 @echo "---------------------"
144 @-export PYTHONPATH=`pwd`:$(PYTHONPATH); nosetests -v --with-id \
145 --with-coverage --cover-package=safe safe 3>&1 1>&2 2>&3 3>&- || true
146
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
147 # This one includes safe and realtime and runs against QGIS v2
11e5ce1 @ismailsunni [Makefile] Remove compile.
ismailsunni authored
148 qgis2_test_suite: testdata
5b1ab87 @timlinux Makefile improvments so we can run all tests against QGIS 2.x
timlinux authored
149 @echo
150 @echo "---------------------"
151 @echo "Regression Test Suite"
152 @echo "---------------------"
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
153 @-export PYTHONPATH=`pwd`:$(PYTHONPATH);export QGIS_DEBUG=0;export QGIS_LOG_FILE=/dev/null;export QGIS_DEBUG_FILE=/dev/null;nosetests -v --with-id --with-coverage --cover-package=safe safe 3>&1 1>&2 2>&3 3>&- | true
5b1ab87 @timlinux Makefile improvments so we can run all tests against QGIS 2.x
timlinux authored
154
4f5148f @timlinux Fix makefile breakages from recent merge from master
timlinux authored
155 # Run realtime test suite only
156 realtime_test_suite:
157
4c956b8 @timlinux Jenkins make target fixes
timlinux authored
158 @echo
159 @echo "-------------------"
160 @echo "Realtime Test Suite"
161 @echo "-------------------"
162
163 @# Preceding dash means that make will continue in case of errors
164 #Quiet version
1250b44 @timlinux Get rid of grep checks for Object::disconnect
timlinux authored
165 @-export PYTHONPATH=`pwd`:$(PYTHONPATH);export QGIS_DEBUG=0;export QGIS_LOG_FILE=/dev/null;export QGIS_DEBUG_FILE=/dev/null;nosetests -v --with-id --with-coverage --cover-package=realtime realtime 3>&1 1>&2 2>&3 3>&- || true
4f5148f @timlinux Fix makefile breakages from recent merge from master
timlinux authored
166
d3f3135 @timlinux Untrampled top level make file
timlinux authored
167 # Get test data
c02eb72 @uniomni Updated hash for test data
uniomni authored
168 # FIXME (Ole): Need to attempt cloning this r/w for those with
169 # commit rights. See issue https://github.com/AIFDR/inasafe/issues/232
d3f3135 @timlinux Untrampled top level make file
timlinux authored
170 testdata:
171 @echo
dc43f81 @uniomni Updated hash
uniomni authored
172 @echo "------------------------------------------------------------"
18e3a26 @timlinux Resolved merge conflicts post merge from master
timlinux authored
173 @echo "Updating inasafe_data - public test and demo data repository"
dc43f81 @uniomni Updated hash
uniomni authored
174 @echo "Update the hash to check out a specific data version "
175 @echo "------------------------------------------------------------"
fc6c74a @akbargumbira Update hash of the test data.
akbargumbira authored
176 @scripts/update-test-data.sh 031389d381dc774d25fdb3fa47e5920a384cd53f 2>&1 | tee tmp_warnings.txt; [ $${PIPESTATUS[0]} -eq 0 ] && rm -f tmp_warnings.txt || echo "Stored update warnings in tmp_warnings.txt";
d3f3135 @timlinux Untrampled top level make file
timlinux authored
177
36a77fa @mbernasocchi Added error reporting in case off git checkout errors in update_test_…
mbernasocchi authored
178 #check and show if there was an error retrieving the test data
179 testdata_errorcheck:
180 @echo
8da2869 @uniomni Makefile output cleanup
uniomni authored
181 @echo "---------------------"
182 @echo "Inasafe_data problems"
183 @echo "---------------------"
184 @[ -f tmp_warnings.txt ] && more tmp_warnings.txt || true; rm -f tmp_warnings.txt
4938e4f @uniomni Moved PEP8 disabled comment to developer docs
uniomni authored
185
d3f3135 @timlinux Untrampled top level make file
timlinux authored
186 disabled_tests:
187 @echo
188 @echo "--------------"
189 @echo "Disabled tests"
190 @echo "--------------"
173b643 @mach0 remove documentation related make targets for #563
mach0 authored
191 @grep -R [X,x]test * | grep ".py:" || true
0f9325e @uniomni Added check for unwanted dependencies and cleaned up in Makefile
uniomni authored
192
d3f3135 @timlinux Untrampled top level make file
timlinux authored
193 unwanted_strings:
194 @echo
195 @echo "------------------------------"
196 @echo "Strings that should be deleted"
197 @echo "------------------------------"
9dfefa6 @timlinux Pylint and unwanted strings fixes
timlinux authored
198
199 @grep -R "settrace()" * | grep ".py:" | grep -v Makefile | grep -v pydev || true
200
201 @grep -R "assert " * | grep ".py:" | grep -v Makefile | grep -v test_ | \
202 grep -v utilities_for_testing.py | grep -v odict.py | grep -v .pyc | \
203 grep -v gui_example.py | grep -v message_element.py | grep -v pydev | \
aa8cbad @timlinux Changed third_party module to safe_extras since third_party is common…
timlinux authored
204 grep -v safe_extras || true
d3f3135 @timlinux Untrampled top level make file
timlinux authored
205
206 dependency_test:
207 @echo
b13f0e4 @uniomni Added translation statistics for gettext (still need to do qt transla…
uniomni authored
208 @echo "------------------------------------------------"
d3f3135 @timlinux Untrampled top level make file
timlinux authored
209 @echo "List of unwanted dependencies in InaSAFE library"
b13f0e4 @uniomni Added translation statistics for gettext (still need to do qt transla…
uniomni authored
210 @echo "------------------------------------------------"
d3f3135 @timlinux Untrampled top level make file
timlinux authored
211
212 @# Need disjunction with "true" because grep returns non-zero error code if no matches were found
213 @# nielso@shakti:~/sandpit/inasafe$ grep PyQt4 engine
214 @# nielso@shakti:~/sandpit/inasafe$ echo $?
215 @# 1
216 @# See http://stackoverflow.com/questions/4761728/gives-an-error-in-makefile-not-in-bash-when-grep-output-is-empty why we need "|| true"
217
fb65487 @timlinux Better checking for unwanted dependencies
timlinux authored
218 @# Since InaSAFE 2.0 we now can use PyQt4 libs in safe lib
219 @#grep -R PyQt4 $(NONGUI) | grep -v gui_example.py | grep -v message_element|| true
220 @# Since InaSAFE 2.0 we now can use qgis libs in safe lib
221 @#grep -R qgis.core $(NONGUI) || true
d3f3135 @timlinux Untrampled top level make file
timlinux authored
222 @grep -R "import scipy" $(NONGUI) || true
223 @grep -R "from scipy import" $(NONGUI) || true
224 @grep -R "django" $(NONGUI) || true
225 @grep -R "geonode" $(NONGUI) || true
226 @grep -R "geoserver" $(NONGUI) || true
227 @grep -R "owslib" $(NONGUI) || true
fb65487 @timlinux Better checking for unwanted dependencies
timlinux authored
228 @# Allowed since 2.0
aa8cbad @timlinux Changed third_party module to safe_extras since third_party is common…
timlinux authored
229 @#grep -R "safe_extras" $(NONGUI) || true
d3f3135 @timlinux Untrampled top level make file
timlinux authored
230
6d9b144 @timlinux Removed references to engine / common etc and to old is_ prefixes
timlinux authored
231 list_gpackages:
d3f3135 @timlinux Untrampled top level make file
timlinux authored
232 @echo
2be5499 @uniomni Poodle Fluffing Makefile
uniomni authored
233 @echo "----------------------------------------"
234 @echo "List of QGis related packages installed."
235 @echo "----------------------------------------"
d3f3135 @timlinux Untrampled top level make file
timlinux authored
236 @dpkg -l | grep qgis || true
237 @dpkg -l | grep gdal || true
238 @dpkg -l | grep geos || true
239
4494fff @uniomni Cosmetics in Makefile
uniomni authored
240 data_audit: testdata run_data_audit
241
242 run_data_audit:
1bef7bc @uniomni Added IP audit to Makefile
uniomni authored
243 @echo
5951e18 @uniomni Poodle fluffing
uniomni authored
244 @echo "-----------------------------------"
245 @echo "Audit of IP status for bundled data"
246 @echo "-----------------------------------"
301eb23 @uniomni Removed patching of sys.path and added PYTHONPATH in Makefile
uniomni authored
247 @-export PYTHONPATH=`pwd`:$(PYTHONPATH); python scripts/data_IP_audit.py
1bef7bc @uniomni Added IP audit to Makefile
uniomni authored
248
2be5499 @uniomni Poodle Fluffing Makefile
uniomni authored
249 pylint-count:
d3f3135 @timlinux Untrampled top level make file
timlinux authored
250 @echo
5951e18 @uniomni Poodle fluffing
uniomni authored
251 @echo "---------------------------"
252 @echo "Number of pylint violations"
253 @echo "For details run make pylint"
254 @echo "---------------------------"
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
255 @pylint --output-format=parseable --reports=n --rcfile=pylintrc safe realtime | wc -l
d3f3135 @timlinux Untrampled top level make file
timlinux authored
256
2be5499 @uniomni Poodle Fluffing Makefile
uniomni authored
257 pylint:
6fcdc66 @uniomni Tightened comparison of vector layers and the test
uniomni authored
258 @echo
5951e18 @uniomni Poodle fluffing
uniomni authored
259 @echo "-----------------"
260 @echo "Pylint violations"
261 @echo "-----------------"
b859f6a @timlinux Print versions of pylint and pep8 in travis and jenkins to make it ea…
timlinux authored
262 @pylint --version
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
263 @pylint --reports=n --rcfile=pylintrc safe realtime || true
6fcdc66 @uniomni Tightened comparison of vector layers and the test
uniomni authored
264
d3f3135 @timlinux Untrampled top level make file
timlinux authored
265 profile:
266 @echo
5951e18 @uniomni Poodle fluffing
uniomni authored
267 @echo "----------------"
268 @echo "Profiling engine"
269 @echo "----------------"
270 python -m cProfile safe/engine/test_engine.py -s time
b13f0e4 @uniomni Added translation statistics for gettext (still need to do qt transla…
uniomni authored
271
f1f626d @uniomni Made pyflakes target
uniomni authored
272 pyflakes:
273 @echo
274 @echo "---------------"
275 @echo "PyFlakes issues"
276 @echo "---------------"
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
277 @-export PYTHONPATH=`pwd`:$(PYTHONPATH); pyflakes safe realtime | wc -l
f1f626d @uniomni Made pyflakes target
uniomni authored
278
9910895 @timlinux Translation fixes for missing dialogs. Remove redundant files. Update…
timlinux authored
279 indent:
280 @echo
281 @echo "---------------"
282 @echo "Check indentation is at 4 spaces (and apply fix)"
283 @echo "---------------"
284 @# sudo apt-get install python2.7-examples for reindent script
285 python /usr/share/doc/python2.7/examples/Tools/scripts/reindent.py *.py
ec1bbd3 @timlinux Makefile cleanups: remove doc gen targets and added target to run saf…
timlinux authored
286
41806ae @timlinux Fix for padang quake small test - expect different outputs based on Q…
timlinux authored
287
288 ##########################################################
289 #
b3d9f2f @timlinux In progress work to support running tests under docker for a homogeno…
timlinux authored
290 # Make targets specific to Docker go below this point
41806ae @timlinux Fix for padang quake small test - expect different outputs based on Q…
timlinux authored
291 #
292 ##########################################################
293
b3d9f2f @timlinux In progress work to support running tests under docker for a homogeno…
timlinux authored
294 docker-run-tests:
218e1df @timlinux Rather use hosted docker repo for test builds
timlinux authored
295 # The image is hosted in docker hub at
296 # https://registry.hub.docker.com/u/inasafe/inasafe-test-runner/
297 docker pull inasafe/inasafe-test-runner
b3d9f2f @timlinux In progress work to support running tests under docker for a homogeno…
timlinux authored
298 #docker rm inasafe-test-runner
299 docker run -i -t --rm --name="inasafe-tests" \
218e1df @timlinux Rather use hosted docker repo for test builds
timlinux authored
300 -v /Users/timlinux/dev/python/inasafe_data/:/inasafe_data \
301 -v /Users/timlinux/dev/python/inasafe:/inasafe \
302 inasafe/inasafe-test-runner \
303 /bin/bash
b3d9f2f @timlinux In progress work to support running tests under docker for a homogeno…
timlinux authored
304
305
41806ae @timlinux Fix for padang quake small test - expect different outputs based on Q…
timlinux authored
306 docker-test: testdata clean
307 @echo
308 @echo "----------------------------------"
309 @echo "Regression Test Suite for running in docker"
310 @echo " against QGIS 2.x"
311 @echo "----------------------------------"
b3d9f2f @timlinux In progress work to support running tests under docker for a homogeno…
timlinux authored
312 @PYTHONPATH=`pwd`:$(PYTHONPATH) xvfb-run \
313 --server-args="-screen 0, 1024x768x24" \
314 nosetests \
315 -v \
316 --with-id \
317 --with-xcoverage \
318 --with-xunit \
319 --verbose \
320 --cover-package=safe safe
41806ae @timlinux Fix for padang quake small test - expect different outputs based on Q…
timlinux authored
321
322
8c01f68 @timlinux Added more Jenkins targets
timlinux authored
323 ##########################################################
324 #
325 # Make targets specific to Jenkins go below this point
326 #
327 ##########################################################
328
4c5abb9 @uniomni Made Jenkins test call clean to make sure test id's are consistent
uniomni authored
329 jenkins-test: testdata clean
8c01f68 @timlinux Added more Jenkins targets
timlinux authored
330 @echo
331 @echo "----------------------------------"
5b1ab87 @timlinux Makefile improvments so we can run all tests against QGIS 2.x
timlinux authored
332 @echo "Regression Test Suite for Jenkins"
f9de3db @timlinux Change message saying that tests are running against qgis 1.x to 2.x
timlinux authored
333 @echo " against QGIS 2.x"
8c01f68 @timlinux Added more Jenkins targets
timlinux authored
334 @echo "----------------------------------"
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
335 @-export PYTHONPATH=`pwd`:$(PYTHONPATH); nosetests --cover-package=safe --with-id --with-xcoverage --with-xunit --verbose --cover-package=safe safe || :
8c01f68 @timlinux Added more Jenkins targets
timlinux authored
336
5b1ab87 @timlinux Makefile improvments so we can run all tests against QGIS 2.x
timlinux authored
337 jenkins-qgis2-test: testdata clean
338 @echo
339 @echo "----------------------------------"
340 @echo "Regression Test Suite for Jenkins"
341 @echo " against QGIS 2.x"
342 @echo "----------------------------------"
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
343 @-export PYTHONPATH=`pwd`:$(PYTHONPATH); nosetests -v --with-id --with-xcoverage --with-xunit --verbose --cover-package=safe,realtime safe realtime || :
5b1ab87 @timlinux Makefile improvments so we can run all tests against QGIS 2.x
timlinux authored
344
8c01f68 @timlinux Added more Jenkins targets
timlinux authored
345 jenkins-pyflakes:
346 @echo
347 @echo "----------------------------------"
348 @echo "PyFlakes check for Jenkins"
349 @echo "----------------------------------"
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
350 @-export PYTHONPATH=`pwd`:$(PYTHONPATH); pyflakes safe realtime > pyflakes.log || :
8c01f68 @timlinux Added more Jenkins targets
timlinux authored
351
352 jenkins-sloccount:
353 @echo "----------------------"
354 @echo " Lines of code analysis for Jenkins"
355 @echo " Generated using David A. Wheeler's 'SLOCCount'"
356 @echo "----------------------"
173b643 @mach0 remove documentation related make targets for #563
mach0 authored
357 # This line is for machine readable output for use by Jenkins
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
358 @sloccount --duplicates --wide --details safe_api.py safe realtime | fgrep -v .svn > sloccount.sc || :
8c01f68 @timlinux Added more Jenkins targets
timlinux authored
359
360 jenkins-pylint:
361 @echo
362 @echo "----------------------------------"
363 @echo "PyLint check for Jenkins"
8297b3b @timlinux Ignore all generated files from gui modules in pylint
timlinux authored
364 @echo " *_base.py modules are ignored since they are autogenerated by Qt4"
a7e81ac @timlinux Lint updates - suppress warnings where they are not relevant. Added l…
timlinux authored
365 @echo " we enable -i y option so that we can see message ids as in some"
366 @echo " cases we want to suppress warnings in the python code like this:"
367 @echo " from pydevd import * # pylint: disable=F0401"
368 @echo " with 'F0401' being the warning code."
8c01f68 @timlinux Added more Jenkins targets
timlinux authored
369 @echo "----------------------------------"
370 rm -f pylint.log
b859f6a @timlinux Print versions of pylint and pep8 in travis and jenkins to make it ea…
timlinux authored
371 @pylint --version
b4ce6ee @akbargumbira Update Makefile
akbargumbira authored
372 @-export PYTHONPATH=$(PYTHONPATH):`pwd`/safe_extras; pylint --output-format=parseable --reports=y --rcfile=pylintrc_jenkins safe realtime> pylint.log || :
8c01f68 @timlinux Added more Jenkins targets
timlinux authored
373
374 jenkins-pep8:
375 @echo
376 @echo "-----------------------------"
377 @echo "PEP8 issue check for Jenkins"
378 @echo "-----------------------------"
b859f6a @timlinux Print versions of pylint and pep8 in travis and jenkins to make it ea…
timlinux authored
379 @pep8 --version
8fc5045 @timlinux pep8 fixes for pep8 1.6.1 - ignore E402 errors
timlinux authored
380 @pep8 --repeat --ignore=E203,E121,E122,E123,E124,E125,E126,E127,E128,E402 --exclude pydev,safe_extras,keywords_dialog_base.py,wizard_dialog_base.py,dock_base.py,options_dialog_base.py,minimum_needs_configuration.py,resources_rc.py,help_base.py,xml_tools.py,system_tools.py,data_audit.py,data_audit_wrapper.py,function_browser_base.py,function_options_dialog_base.py,minimum_needs_base.py,shakemap_importer_base.py,batch_dialog_base.py,osm_downloader_base.py,impact_report_dialog_base.py,impact_merge_dialog_base.py,about_dialog_base.py,extent_selector_base.py,extent_selector_dialog_base.py,function_browser_dialog_base.py,needs_calculator_dialog_base.py,needs_manager_dialog_base.py,osm_downloader_dialog_base.py,shakemap_importer_dialog_base.py . > pep8.log || :
25ba8ec @timlinux Fix jenkins targets for realtime
timlinux authored
381
382 jenkins-realtime-test:
4c956b8 @timlinux Jenkins make target fixes
timlinux authored
383
384 @echo
385 @echo "---------------------------------------------------------------"
386 @echo "Regresssion Test Suite for Jenkins (Realtime module only)"
387 @echo "if you are going to run more than "
388 @echo "one InaSAFE Jenkins job, you should run each on a different"
389 @echo "display by changing the :100 option below to a different number"
4f7c0eb @timlinux Simple typoe fix in Makefile
timlinux authored
390 @echo "Update: Above is taken care of by xvfb jenkins plugin now"
4c956b8 @timlinux Jenkins make target fixes
timlinux authored
391 @echo "---------------------------------------------------------------"
392 # xvfb-run --server-args=":101 -screen 0, 1024x768x24" make check
393 @-export PYTHONPATH=`pwd`:$(PYTHONPATH); xvfb-run --server-args="-screen 0, 1024x768x24" \
394 nosetests -v --with-id --with-xcoverage --with-xunit --verbose --cover-package=realtime realtime || :
Something went wrong with that request. Please try again.