[SoC] Weekly report 6: Testing framework for GRASS GIS
wenzeslaus at gmail.com
Thu Jul 3 20:33:30 PDT 2014
1. What did you get done this week?
After discussion with my mentor I introduced PyGRASS Module class as the
main way to invoke modules in tests. The module is executed by an assert
function, so the run and result can be examined throughly.
I added functions and classes for finding and running tests in GRASS. The
system is based on Python unittest package. Currently, several ways of
invoking tests should be possible but it seems that only one or two will
prevail in the future. The individual test files are executed as separate
processes and there is a main process which controls everything. Most
importantly it controls switching to the given gisdbase and location and it
creates a mapset for each test file.
The tests are loaded from a source tree starting in the current directory.
All files in all testsuite directories are considered as tests and
executed. Only portion of files can be selected by using a global variable
in the file, i.e. only files which can run in the given location.
The main process is now creating a HTML report which is not particularly
fancy but it usable for examining results of larger number of tests.
I updated the documentation to reflect the recent improvements. Although
the documentation is not finished yet, it can be used to write and run
tests when gunittest package is added to PYTHONPATH.
I was thinking hard about the location handling and approach to different
data and projections and I think that I have a solution which can work,
although I don't say that it is simple. The description is in the
2. What do you plan on doing next week?
I plan to put the gutittest package to trunk. The parts needed for writing
tests are more stable then the parts for invoking and report generation, so
I can consider putting only the stable ones to GRASS. I need to improve
command line interface, maybe introduce `make test` and finally I would
like to advance in location handling (which fits to the original plan for
Considering the state of report generation I can be more spacific about
plan for week 10. I will improve report generation for individual test
files, add some paseable outputs, and add different summaries to the main
3. Are you blocked on anything?
I need more tests to see how the ideas about location-specific and
location-independent tests work in actual tests. I will of course use the
existing tests but if you can contribute some more, please do.
Documentation including information about locations and tests
(additional documentation is in docstrings):
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SoC