Opened 7 months ago

Closed 7 months ago

Last modified 6 months ago

#3792 closed enhancement (fixed)

Use unique names on test modules

Reported by: pmav99 Owned by: grass-dev@…
Priority: normal Milestone: 7.8.0
Component: Tests Version: svn-trunk
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description

I am experimenting a bit with running GRASS tests using pytest. If this works out, we should be able to e.g. easily get reports on test coverage.

One of the requirements for using pytest is to have uniquely named test modules. The grass testsuite does have some duplicates filenames though. Regardless of pytest, I think that having unique names is a good idea anyway.

The following commands removes duplicate filenames and thus allow pytest to run:

svn mv lib/python/gunittest/testsuite/test_doctests.py lib/python/gunittest/testsuite/test_gunnitest_doctests.py
svn mv lib/python/pygrass/gis/testsuite/test_doctests.py lib/python/pygrass/gis/testsuite/test_pygrass_gis_doctests.py
svn mv lib/python/pygrass/messages/testsuite/test_doctests.py lib/python/pygrass/messages/testsuite/test_pygrass_messages_doctests.py
svn mv lib/python/pygrass/modules/grid/testsuite/test_doctests.py lib/python/pygrass/modules/grid/testsuite/test_pygrass_modules_grid_doctests.py
svn mv lib/python/pygrass/modules/interface/testsuite/test_doctests.py lib/python/pygrass/modules/interface/testsuite/test_pygrass_modules_interface_doctests.py
svn mv lib/python/pygrass/modules/testsuite/test_doctests.py lib/python/pygrass/modules/testsuite/test_pygrass_modules_doctests.py
svn mv lib/python/pygrass/raster/testsuite/test_doctests.py lib/python/pygrass/raster/testsuite/test_pygrass_raster_doctests.py
svn mv lib/python/pygrass/raster/testsuite/test_raster.py lib/python/pygrass/raster/testsuite/test_pygrass_raster.py
svn mv lib/python/pygrass/rpc/testsuite/test_doctests.py lib/python/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py
svn mv lib/python/pygrass/shell/testsuite/test_doctests.py lib/python/pygrass/shell/testsuite/test_pygrass_shell_doctests.py
svn mv lib/python/pygrass/testsuite/test_doctests.py lib/python/pygrass/testsuite/test_pygrass_doctests.py
svn mv lib/python/pygrass/vector/testsuite/test_doctests.py lib/python/pygrass/vector/testsuite/test_pygrass_vector_doctests.py
svn mv lib/python/script/testsuite/test_doctests.py lib/python/script/testsuite/test_script_doctests.py
svn mv lib/python/script/testsuite/test_raster.py lib/python/script/testsuite/test_script_raster.py
svn mv lib/python/temporal/testsuite/test_doctests.py lib/python/temporal/testsuite/test_temporal_doctests.py
svn mv temporal/t.rast.extract/testsuite/test_extract.py temporal/t.rast.extract/testsuite/test_t_rast_extract.py
svn mv temporal/t.rast.univar/testsuite/test_univar.py temporal/t.rast.univar/testsuite/test_t_rast_univar.py
svn mv temporal/t.rast3d.extract/testsuite/test_extract.py temporal/t.rast3d.extract/testsuite/test_t_rast3d_extract.py
svn mv temporal/t.rast3d.univar/testsuite/test_univar.py temporal/t.rast3d.univar/testsuite/test_t_rast3d_univar.py
svn mv vector/v.extract/testsuite/test_extract.py vector/v.extract/testsuite/test_v_extract.py
svn mv vector/v.in.lidar/testsuite/basic_test.py vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py
svn mv vector/v.in.lidar/testsuite/filter_test.py vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py
svn mv vector/v.in.pdal/testsuite/basic_test.py vector/v.in.lidar/testsuite/test_v_in_pdal_basic.py
svn mv vector/v.in.pdal/testsuite/filter_test.py vector/v.in.lidar/testsuite/test_v_in_pdal_filter.py

After applying, pytest is able to collect python based tests.

Unless they are any specific objections, I would appreciate if this was applied.

Change History (6)

comment:1 Changed 7 months ago by neteler

Resolution: fixed
Status: newclosed

In 74226:

testsuite: use unique names on test modules to better support pytest (fixes #3792) (contributed by pmav99)

comment:2 Changed 7 months ago by neteler

Component: DefaultTests
Milestone: 7.8.0

comment:3 Changed 7 months ago by pmav99

As shown by @sbl here, there was a typo. To fix it the following needs to be applied:

svn mv vector/v.in.lidar/testsuite/test_v_in_pdal_basic.py vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py
svn mv vector/v.in.lidar/testsuite/test_v_in_pdal_filter.py vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py

comment:4 Changed 7 months ago by sbl

In 74303:

Move v.in.pdal tests back; see #3792

comment:5 Changed 6 months ago by pmav99

If possible, please convert the following test to a proper python module name:

raster/r.random/testsuite/test_r.random.py

I guess that this should do it:

svn mv raster/r.random/testsuite/test_r.random.py raster/r.random/testsuite/test_r_random.py

comment:6 Changed 6 months ago by neteler

In 74400:

testsuite: convert the following test to a proper python module name (fixes #3792)

Note: See TracTickets for help on using tickets.