86 | | * The testing framework was written before migration to !Git/GitHub and when long free runs in 3rd party services were unthinkable. Additionally, different goals overall were prioritized. |
87 | | * An update is needed to reflect that tests are used to evaluate pull requests (PRs). |
88 | | * Most of the updates should be generic enough to integrate well with any CI environment. However, currently GRASS GIS is using !GitHub [https://github.com/OSGeo/grass/actions Actions] which open the possibility to make use of specific features there, e.g., upload artifacts for failed tests or do a quick test only of files changed in the PR. |
89 | | * Possibly, use //pytest// (following example of GDAL and Numpy) instead of Python unittest (some parts of grass.gunittest might be replaced by or ported to pytest). |
90 | | * Current tests don't accommodate well tests of the main GRASS executable (which is now more prominent also because `grass ... --exec`). |
91 | | * Both preserving and removing of existing HTML reporting functionality are valid options. |
| 86 | * The current testing framework, ''grass.gunittest'', was written before migration to !Git/GitHub and when long free runs in 3rd party services were unthinkable. Additionally, some no longer relevant goals were prioritized, such as independence on the current code, detailed custom HTML reports, success tracking over time, and high specialization towards GRASS-specifics. |
| 87 | * ''grass.gunittest'' is based on Python ''unittest'' package and many projects since then migrated to //pytest//, e.g., GDAL and Numpy. While ''unittest'' is inspired by Java's JUnit, ''pytest'' is designed to support writing small, readable tests, and uses plain `assert` statements instead of many different assert methods. |
| 88 | * Using ''pytest'' should lead to tests which feel more like Python scripts and to minimum of testing-specific code. |
| 89 | * An example issue of ''grass.gunittest'' is that it doesn't work well with tests of the main GRASS executable (prominence of `grass ... --exec` is yet another new thing which changed since ''grass.gunittest'' was designed). |
| 90 | * Two main things needed: |
| 91 | - Create general comparison functions from the ''grass.gunittest'' assert methods so that they can be used with pytest. |
| 92 | - Current grass.script.setup.init function and grass.script.core.create_location function don't work well in the context of a pytest test function. More |
| 93 | * Additional things needed: |
| 94 | - Fixture for pytest to set up and tear down a GRASS session in a temporary mapset. |