Comments (5)
I think this is now working. The out-of-the-box tests from the Plugin Builder are now running and passing. Next step is to write specific tests for the plugin itself - that's #16.
from gridref-qgis.
We can also add in other things to the Travis config, like running pycodestyle
which checks the 'quality' of your Python (specifically, its conformance to PEP8 guidelines: https://www.python.org/dev/peps/pep-0008/).
from gridref-qgis.
For info, here's a brief breakdown of the Travis config:
# I couldn't get it to work with language: python, hence:
language: generic
# with this set-up, sudo is required for the pip installs
sudo: required
# Trusty is the newest Ubuntu version on Travis
dist: trusty
# Giving two values to the same environment variable means that the tests run once for each value.
# In this case, this means we can test the plugin against QGIS 2.14 (LTR) and 2.18 (latest)
env:
- QGIS_REPO=http://qgis.org/debian-ltr
- QGIS_REPO=http://qgis.org/debian
# Can't remember why this is required - it installs some packages which are needed.
addons:
apt:
packages:
- python-software-properties
# update your repo
-before_install:
- sudo apt-get -qq -y update
install:
# This is where each of the env vars is used, so first the QGIS LTR repo is added, and on the next
# test run, 2.18 is added
- sudo add-apt-repository ${QGIS_REPO}
# update your repos
- sudo apt-get update
# install QGIS, the QGIS Python bindings, and xvfb, which is a virtual display, meaning we can run
# tests for a GUI-based program when we have no video output
- sudo apt-get install -y --force-yes qgis python-qgis xvfb
# install pip to allow installation of Python modules
- sudo -H pip install --upgrade pip
# nose is what runs all the tests in one go
- sudo -H pip install nose
# adds colour to the nose output (optional)
- sudo -H pip install rednose
# This section prepares the environment for running QGIS and finding the location where Travis
# downloaded your plugin from Github
before_script:
- echo "Build starting on " `date`
- export QGIS_PREFIX_PATH=/usr
- export PYTHONPATH=${QGIS_PREFIX_PATH}/share/qgis/python/:${QGIS_PREFIX_PATH}/share/qgis/python/plugins:`pwd`
- echo "PYTHONPATH:" $PYTHONPATH
- export LD_LIBRARY_PATH=${QGIS_PREFIX_PATH}/lib
# I can't remember why we set QGIS_DEBUG to 0
# xvfb runs everything with the virtual video specified for output
# nosestests runs all the tests
script:
- QGIS_DEBUG=0 xvfb-run --server-args="-screen 0, 1024x768x24" nosetests -s --nologcapture -A 'not slow' -v --rednose --verbose
# hopefully self-explanatory
notifications:
email:
- [email protected]
webhooks:
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always
from gridref-qgis.
from gridref-qgis.
The other thing which can be added in is a code coverage check, via a Python module and a service such as Coveralls: https://coveralls.io/github/tomchadwin/qgis2web
from gridref-qgis.
Related Issues (14)
- Please remove unnecessary files HOT 2
- F2 is reserved for renaming layer HOT 2
- Add a module to the processing toolbox HOT 6
- Option to specify the precision of the grid reference
- Implement unit tests HOT 15
- Make copy to clipboard optional (and disabled by default) HOT 1
- Pick Point button does not appear toggled on
- Move precision spinner to panel? HOT 1
- Migration to QGIS 3.0 HOT 4
- Plugin overrides F2 behaviour HOT 1
- Problem with entering the grid ref manually
- Lat/long HOT 2
- Lat/long - reporting HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gridref-qgis.