[GRASS-dev] [GRASS GIS] #3822: Tests for r.basins.fill are broken

#3822: Tests for r.basins.fill are broken
-------------------------+-------------------------
Reporter: pmav99 | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Keywords: | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
These tests are broken both for python 2 and python 3:
- {{{raster/r.basins.fill/testsuite/testrbf.py}}}
-
http://fatra.cnr.ncsu.edu/grassgistests/reports_for_date-2019-03-26-07-00/report_for_nc_spm_full_v2alpha_nc/raster/r.basins.fill/testrbf/index.html

Moreover, the testsuite [https://github.com/GRASS-GIS/grass-
ci/blob/8161cae6d4df311d6560e305644673834c8f7f01/raster/r.basins.fill/testsuite/testrbf.py#L24-L25
overwrites the "elevation" and "geology"] maps thus ruining the test
dataset (at least on python 3):

before running the tests:
{{{
./exec_grass.sh r.univar elevation
Starting GRASS GIS...
Cleaning up temporary files...
Executing <r.univar elevation> ...
  100%
total null and non-null cells: 29535
total null cells: 0

Of the non-null cells:
----------------------
n: 29535
minimum: 89.6269
maximum: 134.301
range: 44.6739
mean: 116.855
mean of absolute values: 116.855
standard deviation: 9.32828
variance: 87.0169
variation coefficient: 7.98278 %
sum: 3451315.7405014
Execution of <r.univar elevation> finished.
Cleaning up default sqlite database ...
Cleaning up temporary files...
}}}
after:
{{{
./exec_grass.sh r.univar elevation
Starting GRASS GIS...
Cleaning up temporary files...
Executing <r.univar elevation> ...
  100%
total null and non-null cells: 29535
total null cells: 29535

Of the non-null cells:
----------------------
n: 0
minimum: -nan
maximum: -nan
range: -nan
mean: -nan
mean of absolute values: -nan
standard deviation: -nan
variance: -nan
variation coefficient: -nan %
sum: -nan
Execution of <r.univar elevation> finished.
Cleaning up default sqlite database ...
Cleaning up temporary files...
}}}

Until someone finds the time to fix them, please add the following
decorator on the Test class:
{{{
import unittest

@unittest.skip("See #3822")
class TestRasterbasin(TestCase):
     # ...
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3822&gt;
GRASS GIS <https://grass.osgeo.org>

#3822: Tests for r.basins.fill are broken
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by neteler):

* Attachment "testrbf_fix_mapnames.diff" added.

Update map names to those used in nc_spm_full_v2alpha

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3822&gt;
GRASS GIS <https://grass.osgeo.org>

#3822: Tests for r.basins.fill are broken
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by neteler):

After renaming the maps (see attached patch) the test passes here.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3822#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3822: Tests for r.basins.fill are broken
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by mmetz):

Replying to [comment:1 neteler]:
> After renaming the maps (see attached patch) the test passes here.

Does it make sense to adjust tests to a test mapset that is 1) not
available, 2) in alpha state?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3822#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3822: Tests for r.basins.fill are broken
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by neteler):

Replying to [comment:2 mmetz]:
> Replying to [comment:1 neteler]:
> > After renaming the maps (see attached patch) the test passes here.
>
> Does it make sense to adjust tests to a test location that is 1) not
available,

It is available:
http://fatra.cnr.ncsu.edu/data/

> 2) in alpha state?

In the end I only restored the names of the standard sample data set and
found that the tests works.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3822#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3822: Tests for r.basins.fill are broken
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by pmav99):

After applying the patch, the tests do pass, but the "elevation" map still
gets corrupted.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3822#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3822: Tests for r.basins.fill are broken
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by sbl):

In [changeset:"74423" 74423]:
{{{
#!CommitTicketReference repository="" revision="74423"
deactivate erroneous test; see #3822
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3822#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3822: Tests for r.basins.fill are broken
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by sbl):

The test actually only tests if the module works, but contains additinal
tests that have nothing to to with the module in question (and rather
tests data or other modules). Took the liberty to deactivate the test
until fixed with proper test cases.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3822#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>