planetfederal / qgis-suite-plugin

GNU General Public License v2.0
25 stars 17 forks source link

add nose integration for testing #70

Closed ischneider closed 10 years ago

ischneider commented 10 years ago

This branch gets things started: https://github.com/ischneider/suite-qgis-plugin/tree/nose-tests

Right now the behavior is to run all the tests though by using nose, there is much control over what to run.

This requires nose (1.3), coverage and nose_html. I install them like this:

PYTHONPATH=src/opengeo/ext_libs  easy_install -a -d src/opengeo/ext_libs nose
PYTHONPATH=src/opengeo/ext_libs  easy_install -a -d src/opengeo/ext_libs nose-html
PYTHONPATH=src/opengeo/ext_libs  easy_install -a -d src/opengeo/ext_libs coverage

To run in qgis, use the python console:

from opengeo.test import nosetests

The output will be in:

src/opengeo/test/test-output/

Check out the tests-report.html and the coverage/index.html reports there.

Let's discuss more before merging.

jj0hns0n commented 10 years ago

I tested this and got some basic output. Many failures, but alot of them look like I just havent cleaned up from previous runs effectively.

@volaya lets discuss tomorrow, but I would like to get this merged and also to figure out a good cleanup method as well as a good way to have the errors be reported to sentry automatically. Maybe we can have a flag in the explorer settings to automatically send the errors and then just enable that before running tests.

We are in much better shape than we were this time last week, just need to get these all passing consistently and in a repeatable way and then we can work on expanding the test suite and working to get this running in a jenkins slave.