Ribasim
Ribasim copied to clipboard
Test QGIS plugin
We have an ever-growing of QGIS issues, and we typically notice them weeks after it broke in the code. The data loading was broken for three months and nobody noticed: https://github.com/Deltares/Ribasim/issues/291 That is because we don't have any kind of automatic tests for the QGIS plugin at the moment. This is not only the case because it was never prioritized, but also because it is exceptionally hard to do. This is the case because of two reasons:
- GUIs are harder to test than CLI applications or libraries
- We don't control the whole stack
To elaborate on the second point: We don't ship QGIS with our plugin, but expect users to install the plugin on top of their existing QGIS application. This means that we are confined by QGIS' API, making testing (and many other things) much harder.
I think this issue needs further discussion, mostly because it is unclear to me if the QGIS plugin is valuable enough to justify that kind of investment. https://github.com/Deltares/Ribasim/issues/321
This is how the iMOD QGIS plugin tests its functionality: https://github.com/Deltares/imod-qgis/blob/main/.github/workflows/tests.yml
I think this issue needs further discussion, mostly because it is unclear to me if the QGIS plugin is valuable enough to justify that kind of investment. https://github.com/Deltares/Ribasim/issues/321
It's worth noting that we have multiple QGIS plugins (iMOD-QGIS, QGIS-Tim, Ribasim), and the picture painted above is more or less true for all. Joeri has done some figuring out for iMOD-QGIS but it needs more work. So any investment into figuring things out (which to be honest doesn't look that complicated; EDIT: with this I mean actually writing the tests, not the docker stuff...) should be combined so all plugins can benefit.
There is a good amount of logic that isn't Qt/GUI related. Writing the tests for these parts isn't especially hard (after you have a QGIS interpreter installed and running, that is...).
Let's test whether it works now (with QGIS bugs fixed)
Manual checks needed on:
- [ ] adding nodes and edges
- [ ] inspect and change the attributes for the tables
- [ ] visualize the output in timeseries graphs
- [ ] visualize the output in animated maps