Closed billgeo closed 4 years ago
We were thinking end to end testing of QGIS UI, using containerization, but maybe this is overkill? Looking at other LINZ QGIS plugins it seems that no one else is doing this.
This stack exchange post seems to cover how to do testing in QGIS container. Unfortunately the Boundless blog post on this is a broken link since they were bought out by Planet software. https://gis.stackexchange.com/questions/71206/writing-automated-tests-for-qgis-plugins
Would appreciate any help, discussion or links to best practice etc @dwsilk @imincik @palmerj
See (perhaps poorly named) unittest
step here: https://github.com/linz/nz-buildings/blob/master/.github/workflows/build.yml
This uses docker-compose
, with a PostgreSQL/PostGIS container and a QGIS container, and the test_runner
that was originally developed by Boundless in your link above.
Official QGIS docker containers contain test helper scripts that were originally created and maintained by Boundless.
Thanks @dwsilk . We will do something similar.
Decisions:
@billgeo I would suggest the following:
Note if timeframes are a problem you can drop 1/, but my feeling is that will help with the development of the component with CI. e.g setup of docker containers and running tests for those containers.
I think we should use pytest (rather than unittest) and pgTap for the database and python testing frameworks.
Thanks @palmerj seems to be the consensus to some DB testing. @strk also suggested testing the schema (at least) in a PR elsewhere (that I now can't find).
Cool. @strk comment is here https://github.com/linz/gazetteer/issues/62#issuecomment-597682363
I think we should use pytest (rather than unittest)
I think this would require a number of changes to the way testing is handled by the official QGIS docker containers, but I'd like to use pytest
too, so if it can be done..
I think this would require a number of changes to the way testing is handled by the official QGIS docker containers, but I'd like to use pytest too, so if it can be done..
Hmm.. What's the level of changes needed?
Done. We have:
Task
The gazetteer has no automated testing. For the health of the product and to allow us to make changes we need automated testing.
To do this we need to know how much testing is needed, high level view of how we will test and also consider any migration that will be necessary when migration the plugin from QGIS 2 -> 3
Definition of Done :
Out of Scope
Discussion required
Add an Assignee, Epics, Estimate and any relevant Labels.