From 34ad40d5b17564c734d28893e9a6d8b9d7692d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:45:55 -0400 Subject: [PATCH 01/42] grass.gunittest: Add xfail_windows decorator for Windows expected failures --- python/grass/gunittest/utils.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/python/grass/gunittest/utils.py b/python/grass/gunittest/utils.py index c1afea3d5ad..c79fd631504 100644 --- a/python/grass/gunittest/utils.py +++ b/python/grass/gunittest/utils.py @@ -14,6 +14,9 @@ from pathlib import Path import shutil import sys +from unittest import expectedFailure +import warnings + def ensure_dir(directory): @@ -80,3 +83,16 @@ def safe_repr(obj, short=False): if not short or len(result) < _MAX_LENGTH: return result return result[:_MAX_LENGTH] + " [truncated]..." + + +def xfail_windows(test_item): + """Marks a test as an expected failure or error only on Windows + + Equivalent to applying @unittest.expectedFailure only when running + on Windows. + """ + if not sys.platform.startswith("win"): + return lambda func: func + warnings.warn("Once the test is fixed and passing, remove the" + "@xfail_windows decorator") + return expectedFailure(test_item) From 8f9b9dd6bb6e37304ba2f986d3c7107ba1936518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:53:27 -0400 Subject: [PATCH 02/42] lib/imagery: Add xfail_windows decorator to test functions --- lib/imagery/testsuite/test_imagery_signature_management.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/imagery/testsuite/test_imagery_signature_management.py b/lib/imagery/testsuite/test_imagery_signature_management.py index 7b1dc8bdc57..186a64c797b 100644 --- a/lib/imagery/testsuite/test_imagery_signature_management.py +++ b/lib/imagery/testsuite/test_imagery_signature_management.py @@ -15,6 +15,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows from grass.script.core import tempname import grass.script as gs @@ -44,6 +45,7 @@ class GetSignaturesDirTestCase(TestCase): + @xfail_windows def test_get_sig(self): cdir = ctypes.create_string_buffer(GNAME_MAX) I_get_signatures_dir(cdir, I_SIGFILE_TYPE_SIG) @@ -54,6 +56,7 @@ def test_get_sigset(self): I_get_signatures_dir(cdir, I_SIGFILE_TYPE_SIGSET) self.assertEqual(utils.decode(cdir.value), f"signatures{HOST_DIRSEP}sigset") + @xfail_windows def test_get_libsvm(self): elem = ctypes.create_string_buffer(GNAME_MAX) I_get_signatures_dir(elem, I_SIGFILE_TYPE_LIBSVM) From 0131b6e6c42861a1533d6c65fe14fd360a4eafaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:17:04 -0400 Subject: [PATCH 03/42] Fix spacing issue in xfail_windows warning message --- python/grass/gunittest/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/grass/gunittest/utils.py b/python/grass/gunittest/utils.py index c79fd631504..10f4e0924be 100644 --- a/python/grass/gunittest/utils.py +++ b/python/grass/gunittest/utils.py @@ -93,6 +93,6 @@ def xfail_windows(test_item): """ if not sys.platform.startswith("win"): return lambda func: func - warnings.warn("Once the test is fixed and passing, remove the" + warnings.warn("Once the test is fixed and passing, remove the " "@xfail_windows decorator") - return expectedFailure(test_item) + return expectedFailure(test_item) \ No newline at end of file From f9f6553297bbc6271e4a49807151e8f8596fbec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:18:10 -0400 Subject: [PATCH 04/42] Add stacklevel=2 to xfail_windows decorator warning message --- python/grass/gunittest/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/grass/gunittest/utils.py b/python/grass/gunittest/utils.py index 10f4e0924be..c12c19b1e50 100644 --- a/python/grass/gunittest/utils.py +++ b/python/grass/gunittest/utils.py @@ -94,5 +94,5 @@ def xfail_windows(test_item): if not sys.platform.startswith("win"): return lambda func: func warnings.warn("Once the test is fixed and passing, remove the " - "@xfail_windows decorator") + "@xfail_windows decorator", stacklevel=2) return expectedFailure(test_item) \ No newline at end of file From 1064dff8eb47fc096f1f47cb3de60df1a2c9562c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:21:28 -0400 Subject: [PATCH 05/42] Update utils.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- python/grass/gunittest/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/grass/gunittest/utils.py b/python/grass/gunittest/utils.py index c12c19b1e50..2b451c9263a 100644 --- a/python/grass/gunittest/utils.py +++ b/python/grass/gunittest/utils.py @@ -87,7 +87,6 @@ def safe_repr(obj, short=False): def xfail_windows(test_item): """Marks a test as an expected failure or error only on Windows - Equivalent to applying @unittest.expectedFailure only when running on Windows. """ From a3715411238e61df05e73bd4ad2fc3a06dae46ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:25:32 -0400 Subject: [PATCH 06/42] Format end of file --- python/grass/gunittest/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/grass/gunittest/utils.py b/python/grass/gunittest/utils.py index 2b451c9263a..f623ccc021b 100644 --- a/python/grass/gunittest/utils.py +++ b/python/grass/gunittest/utils.py @@ -94,4 +94,4 @@ def xfail_windows(test_item): return lambda func: func warnings.warn("Once the test is fixed and passing, remove the " "@xfail_windows decorator", stacklevel=2) - return expectedFailure(test_item) \ No newline at end of file + return expectedFailure(test_item) From c2f9bdd1619edf9a3821526364de416efdb1d93f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:41:32 -0400 Subject: [PATCH 07/42] Comment out warning in decorator --- python/grass/gunittest/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/grass/gunittest/utils.py b/python/grass/gunittest/utils.py index f623ccc021b..055307ca245 100644 --- a/python/grass/gunittest/utils.py +++ b/python/grass/gunittest/utils.py @@ -92,6 +92,6 @@ def xfail_windows(test_item): """ if not sys.platform.startswith("win"): return lambda func: func - warnings.warn("Once the test is fixed and passing, remove the " - "@xfail_windows decorator", stacklevel=2) + # warnings.warn("Once the test is fixed and passing, remove the " + # "@xfail_windows decorator", stacklevel=2) return expectedFailure(test_item) From e3d2b74e97730b04962079fa55fb5a9046606584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:54:07 -0400 Subject: [PATCH 08/42] i.maxlik: Add xfail_windows decorator to SuccessTest class --- imagery/i.maxlik/testsuite/test_i_maxlik.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imagery/i.maxlik/testsuite/test_i_maxlik.py b/imagery/i.maxlik/testsuite/test_i_maxlik.py index 1f6829e92b4..552d8e00328 100644 --- a/imagery/i.maxlik/testsuite/test_i_maxlik.py +++ b/imagery/i.maxlik/testsuite/test_i_maxlik.py @@ -19,6 +19,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows from grass.lib.gis import G_mapset_path from grass.lib.raster import Rast_write_semantic_label @@ -36,6 +37,7 @@ ) +@xfail_windows class SuccessTest(TestCase): """Test successful classification""" From c039635395945a04dcfbc586bc72cea818289c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:56:56 -0400 Subject: [PATCH 09/42] lib/gis: Add xfail_windows decorator to TestNewlinesWithGetlFunctions class --- lib/gis/testsuite/test_gis_lib_getl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/gis/testsuite/test_gis_lib_getl.py b/lib/gis/testsuite/test_gis_lib_getl.py index 98092955ab2..8dca35de496 100644 --- a/lib/gis/testsuite/test_gis_lib_getl.py +++ b/lib/gis/testsuite/test_gis_lib_getl.py @@ -11,8 +11,10 @@ import grass.lib.gis as libgis from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows +@xfail_windows class TestNewlinesWithGetlFunctions(TestCase): """Test C functions G_getl() and G_getl2() from gis library""" From 87c317db35aba3a04283daa52423c374162fbe69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 18 Sep 2024 21:03:45 -0400 Subject: [PATCH 10/42] Update warning stacklevel to 3 --- python/grass/gunittest/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/grass/gunittest/utils.py b/python/grass/gunittest/utils.py index 055307ca245..7c4422398e9 100644 --- a/python/grass/gunittest/utils.py +++ b/python/grass/gunittest/utils.py @@ -92,6 +92,6 @@ def xfail_windows(test_item): """ if not sys.platform.startswith("win"): return lambda func: func - # warnings.warn("Once the test is fixed and passing, remove the " - # "@xfail_windows decorator", stacklevel=2) + warnings.warn("Once the test is fixed and passing, remove the " + "@xfail_windows decorator", stacklevel=3) return expectedFailure(test_item) From 69cac23add67f87b9ee15f35426a007d1b184ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:48:04 -0400 Subject: [PATCH 11/42] Update utils.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- python/grass/gunittest/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/grass/gunittest/utils.py b/python/grass/gunittest/utils.py index 7c4422398e9..be851da3edf 100644 --- a/python/grass/gunittest/utils.py +++ b/python/grass/gunittest/utils.py @@ -18,7 +18,6 @@ import warnings - def ensure_dir(directory): """Create all directories in the given path if needed.""" if not os.path.exists(directory): From ffac6b6295a52d9183c0961e8d6c62ccf02b425d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:48:34 -0400 Subject: [PATCH 12/42] Update utils.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- python/grass/gunittest/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/grass/gunittest/utils.py b/python/grass/gunittest/utils.py index be851da3edf..fc3682ba9ac 100644 --- a/python/grass/gunittest/utils.py +++ b/python/grass/gunittest/utils.py @@ -91,6 +91,8 @@ def xfail_windows(test_item): """ if not sys.platform.startswith("win"): return lambda func: func - warnings.warn("Once the test is fixed and passing, remove the " - "@xfail_windows decorator", stacklevel=3) + warnings.warn( + "Once the test is fixed and passing, remove the " "@xfail_windows decorator", + stacklevel=3, + ) return expectedFailure(test_item) From 2abdcd07125f5d857c9d74fd54f30c035dcf8b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:49:27 -0400 Subject: [PATCH 13/42] Update utils.py --- python/grass/gunittest/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/grass/gunittest/utils.py b/python/grass/gunittest/utils.py index fc3682ba9ac..5313dbb9bc8 100644 --- a/python/grass/gunittest/utils.py +++ b/python/grass/gunittest/utils.py @@ -92,7 +92,7 @@ def xfail_windows(test_item): if not sys.platform.startswith("win"): return lambda func: func warnings.warn( - "Once the test is fixed and passing, remove the " "@xfail_windows decorator", - stacklevel=3, + "Once the test is fixed and passing, remove the @xfail_windows decorator", + stacklevel=2, ) return expectedFailure(test_item) From f892eb74bd535a7183516037a95f20064566577f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Thu, 19 Sep 2024 21:50:02 +0000 Subject: [PATCH 14/42] tests: Add expected failures to failing tests on windows --- python/grass/grassdb/testsuite/test_manage.py | 5 +++++ python/grass/gunittest/testsuite/test_assertions.py | 3 +++ python/grass/gunittest/testsuite/test_checkers.py | 2 ++ python/grass/jupyter/testsuite/map3d_test.py | 5 +++++ python/grass/pygrass/raster/testsuite/test_category.py | 2 ++ python/grass/pygrass/raster/testsuite/test_numpy.py | 2 ++ python/grass/pygrass/raster/testsuite/test_raster_img.py | 5 +++++ .../script/testsuite/test_start_command_functions.py | 3 +++ python/grass/script/testsuite/test_utils.py | 2 ++ raster/r.kappa/testsuite/test_r_kappa.py | 2 ++ raster/r.mfilter/testsuite/test_r_mfilter.py | 7 +++++++ raster/r.report/testsuite/test_r_report.py | 2 ++ scripts/g.extension/testsuite/test_addons_modules.py | 7 ++++++- scripts/g.extension/testsuite/test_addons_toolboxes.py | 4 ++++ scripts/r.tileset/testsuite/test_r_tileset.py | 3 +++ scripts/v.rast.stats/testsuite/test_v_rast_stats.py | 6 ++++++ temporal/t.rast.gapfill/testsuite/test_gapfill.py | 6 ++++++ temporal/t.rast.univar/testsuite/test_t_rast_univar.py | 9 +++++++++ temporal/t.rast.what/testsuite/test_what.py | 5 +++++ .../t.rast3d.univar/testsuite/test_t_rast3d_univar.py | 5 +++++ 20 files changed, 84 insertions(+), 1 deletion(-) diff --git a/python/grass/grassdb/testsuite/test_manage.py b/python/grass/grassdb/testsuite/test_manage.py index a2788d4f1a8..43b8945bd31 100644 --- a/python/grass/grassdb/testsuite/test_manage.py +++ b/python/grass/grassdb/testsuite/test_manage.py @@ -18,6 +18,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.gmodules import call_module from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows class TestMapsetPath(TestCase): @@ -38,6 +39,7 @@ def test_mapset_from_path_object(self): self.assertEqual(mapset_path.mapset, mapset_name) self.assertEqual(mapset_path.path, Path(path) / location_name / mapset_name) + @xfail_windows def test_mapset_from_str(self): """Check with path from str and database directory as Path""" path = "does/not/exist" @@ -60,6 +62,7 @@ def test_mapset_from_str(self): class TestSplitMapsetPath(TestCase): """Check that split works with different parameters""" + @xfail_windows def test_split_path(self): """Check that pathlib.Path is correctly split""" ref_db = "does/not/exist" @@ -71,6 +74,7 @@ def test_split_path(self): self.assertEqual(new_location, ref_location) self.assertEqual(new_mapset, ref_mapset) + @xfail_windows def test_split_str(self): """Check that path as str is correctly split""" ref_db = "does/not/exist" @@ -82,6 +86,7 @@ def test_split_str(self): self.assertEqual(new_location, ref_location) self.assertEqual(new_mapset, ref_mapset) + @xfail_windows def test_split_str_trailing_slash(self): """Check that path as str with a trailing slash is correctly split""" ref_db = "does/not/exist" diff --git a/python/grass/gunittest/testsuite/test_assertions.py b/python/grass/gunittest/testsuite/test_assertions.py index 3af538132f3..ed27c0e54fb 100644 --- a/python/grass/gunittest/testsuite/test_assertions.py +++ b/python/grass/gunittest/testsuite/test_assertions.py @@ -11,6 +11,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows class TestTextAssertions(TestCase): @@ -34,6 +35,7 @@ def test_assertLooksLike(self): def test_assertLooksLike_multiline(self): self.assertLooksLike("a=123\nb=456\nc=789", "a=...\nb=...\nc=...") + @xfail_windows def test_assertLooksLike_multiline_platform_dependent(self): self.assertLooksLike( "a=123\nb=456\nc=789", "a=...{nl}b=...{nl}c=...".format(nl=os.linesep) @@ -384,6 +386,7 @@ def test_assertFileExists_empty_file(self): self.failureException, self.assertFileExists, filename=self.emtpy_file ) + @xfail_windows def test_assertFileMd5(self): self.assertFileMd5(filename=self.file_with_md5, md5=self.file_md5) self.assertRaises( diff --git a/python/grass/gunittest/testsuite/test_checkers.py b/python/grass/gunittest/testsuite/test_checkers.py index d35ffcb19d8..b11b25778a3 100644 --- a/python/grass/gunittest/testsuite/test_checkers.py +++ b/python/grass/gunittest/testsuite/test_checkers.py @@ -24,6 +24,7 @@ file_md5, text_file_md5, ) +from grass.gunittest.utils import xfail_windows class TestValuesEqual(TestCase): @@ -386,6 +387,7 @@ def tearDownClass(cls): try_remove(cls.correct_file_name_unix_nl) try_remove(cls.wrong_file_name) + @xfail_windows def test_text_file_binary(self): r"""File with ``\n`` (LF) newlines as binary (MD5 has ``\n``).""" self.assertEqual( diff --git a/python/grass/jupyter/testsuite/map3d_test.py b/python/grass/jupyter/testsuite/map3d_test.py index b28b6a03a5b..5f88fad24e7 100644 --- a/python/grass/jupyter/testsuite/map3d_test.py +++ b/python/grass/jupyter/testsuite/map3d_test.py @@ -26,6 +26,7 @@ import grass.jupyter as gj from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows def can_import_ipython(): @@ -81,12 +82,14 @@ def tearDown(self): else: file.unlink(missing_ok=True) + @xfail_windows def test_defaults(self): """Check that default settings work""" renderer = gj.Map3D() renderer.render(elevation_map="elevation", color_map="elevation") self.assertFileExists(renderer.filename) + @xfail_windows def test_filename(self): """Check that custom filename works""" custom_filename = "test_filename.png" @@ -96,12 +99,14 @@ def test_filename(self): renderer.render(elevation_map="elevation", color_map="elevation") self.assertFileExists(custom_filename) + @xfail_windows def test_hw(self): """Check that custom width and height works""" renderer = gj.Map3D(width=200, height=400) renderer.render(elevation_map="elevation", color_map="elevation") self.assertFileExists(renderer.filename) + @xfail_windows def test_overlay(self): """Check that overlay works""" renderer = gj.Map3D() diff --git a/python/grass/pygrass/raster/testsuite/test_category.py b/python/grass/pygrass/raster/testsuite/test_category.py index 527c43b894f..113264c82f6 100644 --- a/python/grass/pygrass/raster/testsuite/test_category.py +++ b/python/grass/pygrass/raster/testsuite/test_category.py @@ -6,6 +6,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows from grass.pygrass.raster import RasterRow from grass.pygrass.raster.category import Category @@ -76,6 +77,7 @@ def testFirstCat(self): self.assertEqual(cats[7], cat7) self.assertEqual(cats[15], cat15) + @xfail_windows def testWrite(self): tmpfile = tempfile(False) cats = Category(self.name) diff --git a/python/grass/pygrass/raster/testsuite/test_numpy.py b/python/grass/pygrass/raster/testsuite/test_numpy.py index 5f0b2309544..b23926d8ba7 100644 --- a/python/grass/pygrass/raster/testsuite/test_numpy.py +++ b/python/grass/pygrass/raster/testsuite/test_numpy.py @@ -6,6 +6,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows from numpy.random import default_rng from grass.pygrass.raster import raster2numpy, numpy2raster, RasterRow @@ -48,6 +49,7 @@ def test_len(self): self.assertTrue(len(self.numpy_obj), 40) self.assertTrue(len(self.numpy_obj[0]), 60) + @xfail_windows def test_write(self): rng = default_rng() numpy2raster(rng.random([40, 60]), "FCELL", self.name, True) diff --git a/python/grass/pygrass/raster/testsuite/test_raster_img.py b/python/grass/pygrass/raster/testsuite/test_raster_img.py index bbc1cb2dabd..9840411f337 100644 --- a/python/grass/pygrass/raster/testsuite/test_raster_img.py +++ b/python/grass/pygrass/raster/testsuite/test_raster_img.py @@ -3,6 +3,8 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows + from grass.pygrass.raster import raster2numpy_img from grass.pygrass.gis.region import Region @@ -149,6 +151,7 @@ def test_resampling_to_numpy_img_1(self): self.assertEqual(len(a), region.rows * region.cols * 4) + @xfail_windows def test_resampling_to_numpy_img_2(self): region = Region() region.ewres = 1 @@ -159,6 +162,7 @@ def test_resampling_to_numpy_img_2(self): self.assertEqual(len(a), region.rows * region.cols * 4) + @xfail_windows def test_resampling_to_numpy_img_3(self): region = Region() region.ewres = 0.4 @@ -169,6 +173,7 @@ def test_resampling_to_numpy_img_3(self): self.assertEqual(len(a), region.rows * region.cols * 1) + @xfail_windows def test_resampling_to_numpy_img_4(self): region = Region() region.ewres = 0.1 diff --git a/python/grass/script/testsuite/test_start_command_functions.py b/python/grass/script/testsuite/test_start_command_functions.py index 414a68cd270..368669263a8 100644 --- a/python/grass/script/testsuite/test_start_command_functions.py +++ b/python/grass/script/testsuite/test_start_command_functions.py @@ -4,6 +4,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows from grass.script.core import start_command, PIPE, run_command, write_command from grass.script.core import read_command, find_program @@ -85,6 +86,7 @@ def setUpClass(cls): def tearDownClass(cls): cls.runModule("g.remove", type="raster", name=cls.raster, flags="f") + @xfail_windows def test_write_labels_unicode(self): """This tests if Python module works""" find_program("ls", "--version") @@ -99,6 +101,7 @@ def test_write_labels_unicode(self): self.assertEqual(res, "1:kůň\n2:kráva\n3:ovečka\n4:býk") self.assertIsInstance(res, str) + @xfail_windows def test_write_labels_bytes(self): """This tests if Python module works""" write_command( diff --git a/python/grass/script/testsuite/test_utils.py b/python/grass/script/testsuite/test_utils.py index db12041d66d..67d2c59dd69 100644 --- a/python/grass/script/testsuite/test_utils.py +++ b/python/grass/script/testsuite/test_utils.py @@ -2,6 +2,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows from grass.script import utils @@ -39,6 +40,7 @@ def test_bytes(self): def test_unicode(self): self.assertEqual(b"text", utils.encode("text")) + @xfail_windows def test_bytes_garbage_in_out(self): """If the input is bytes we should not touch it for encoding""" self.assertEqual( diff --git a/raster/r.kappa/testsuite/test_r_kappa.py b/raster/r.kappa/testsuite/test_r_kappa.py index 56e356ca20b..620a4f4979b 100644 --- a/raster/r.kappa/testsuite/test_r_kappa.py +++ b/raster/r.kappa/testsuite/test_r_kappa.py @@ -21,6 +21,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test from grass.gunittest.checkers import keyvalue_equals +from grass.gunittest.utils import xfail_windows class MatrixCorrectnessTest(TestCase): @@ -474,6 +475,7 @@ def test_stdout(self): keyvalue_equals(self.expected_outputs[i], json_out, precision=4) ) + @xfail_windows def test_file(self): for i in range(len(self.references)): f = NamedTemporaryFile() diff --git a/raster/r.mfilter/testsuite/test_r_mfilter.py b/raster/r.mfilter/testsuite/test_r_mfilter.py index 3d1764b4894..c18aa7c9273 100644 --- a/raster/r.mfilter/testsuite/test_r_mfilter.py +++ b/raster/r.mfilter/testsuite/test_r_mfilter.py @@ -1,6 +1,7 @@ from tempfile import NamedTemporaryFile from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows class TestNeighbors(TestCase): @@ -202,6 +203,7 @@ def tearDownClass(cls): "g.remove", flags="f", type="raster", name=",".join(cls.to_remove) ) + @xfail_windows def test_sequential(self): """Test output with sequential filter type.""" test_case = "test_sequential" @@ -235,6 +237,7 @@ def test_sequential(self): precision=1e-5, ) + @xfail_windows def test_parallel(self): """Test output with parallel filter type.""" test_case = "test_parallel" @@ -268,6 +271,7 @@ def test_parallel(self): precision=1e-5, ) + @xfail_windows def test_sequential_null(self): """Test output with sequential filter type with null mode enabled.""" test_case = "test_sequential_null" @@ -301,6 +305,7 @@ def test_sequential_null(self): precision=1e-5, ) + @xfail_windows def test_parallel_null(self): """Test output with parallel filter type with null mode enabled.""" test_case = "test_parallel_null" @@ -361,6 +366,7 @@ def test_parallel_null(self): precision=1e-5, ) + @xfail_windows def test_multiple_filters(self): """Test output with multiple filters.""" test_case = "test_multiple_filters" @@ -394,6 +400,7 @@ def test_multiple_filters(self): precision=1e-5, ) + @xfail_windows def test_repeated_filters(self): """Test output with repeated filters.""" test_case = "test_repeated_filters" diff --git a/raster/r.report/testsuite/test_r_report.py b/raster/r.report/testsuite/test_r_report.py index 53e49fdc174..86a16c27adb 100644 --- a/raster/r.report/testsuite/test_r_report.py +++ b/raster/r.report/testsuite/test_r_report.py @@ -17,6 +17,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows class TestRasterreport(TestCase): @@ -294,6 +295,7 @@ def test_json(self): data = json.loads(module.outputs.stdout) self._assert_report_equal(reference, data) + @xfail_windows def test_json2(self): """Test JSON format with more options""" reference = { diff --git a/scripts/g.extension/testsuite/test_addons_modules.py b/scripts/g.extension/testsuite/test_addons_modules.py index c1cab5c954a..9b99e7ac2ae 100644 --- a/scripts/g.extension/testsuite/test_addons_modules.py +++ b/scripts/g.extension/testsuite/test_addons_modules.py @@ -15,7 +15,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule -from grass.gunittest.utils import silent_rmtree +from grass.gunittest.utils import silent_rmtree, xfail_windows from grass.script.utils import decode import os @@ -52,6 +52,7 @@ class TestModulesMetadata(TestCase): url = "file://" + os.path.abspath("data") + @xfail_windows def test_listing(self): """List individual extensions/modules/addons""" module = SimpleModule("g.extension", flags="l", url=self.url) @@ -90,6 +91,7 @@ def tearDown(self): """Remove created files""" silent_rmtree(self.install_prefix) + @xfail_windows def test_directory_install(self): """Test installing extension from directory""" self.assertModule( @@ -102,6 +104,7 @@ def test_directory_install(self): for file in self.files: self.assertFileExists(file) + @xfail_windows def test_targz_install(self): """Test installing extension from local .tar.gz""" self.assertModule( @@ -113,6 +116,7 @@ def test_targz_install(self): for file in self.files: self.assertFileExists(file) + @xfail_windows def test_remote_targz_without_dir_install(self): """Test installing extension from (remote) .tar.gz without main dir""" self.assertModule( @@ -125,6 +129,7 @@ def test_remote_targz_without_dir_install(self): for file in self.files: self.assertFileExists(file) + @xfail_windows def test_remote_zip_install(self): """Test installing extension from .zip specified by URL (local)""" self.assertModule( diff --git a/scripts/g.extension/testsuite/test_addons_toolboxes.py b/scripts/g.extension/testsuite/test_addons_toolboxes.py index 5cbc0454a41..dfca44a5c02 100644 --- a/scripts/g.extension/testsuite/test_addons_toolboxes.py +++ b/scripts/g.extension/testsuite/test_addons_toolboxes.py @@ -15,9 +15,12 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows import os +from python.grass.gunittest.utils import xfail_windows + FULL_TOOLBOXES_OUTPUT = """\ Hydrology (HY) * r.stream.basins @@ -39,6 +42,7 @@ class TestToolboxesMetadata(TestCase): url = "file://" + os.path.abspath("data") + @xfail_windows def test_listing(self): """List toolboxes and their content""" module = SimpleModule("g.extension", flags="lt", url=self.url) diff --git a/scripts/r.tileset/testsuite/test_r_tileset.py b/scripts/r.tileset/testsuite/test_r_tileset.py index 7f1c62ed1f5..15545512aea 100644 --- a/scripts/r.tileset/testsuite/test_r_tileset.py +++ b/scripts/r.tileset/testsuite/test_r_tileset.py @@ -7,11 +7,13 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows from grass.script.utils import decode import os + output = """\ -78.77462049|35.6875073|-78.60830318|35.74855834|1506|678 -78.77462049|35.74855834|-78.60830318|35.80960938|1506|678 @@ -36,6 +38,7 @@ def tearDownClass(cls): """!Remove the temporary region""" cls.del_temp_region() + @xfail_windows def test_tiling(self): """Produce tiling test""" module = SimpleModule( diff --git a/scripts/v.rast.stats/testsuite/test_v_rast_stats.py b/scripts/v.rast.stats/testsuite/test_v_rast_stats.py index ca3111d14d8..56acbce5964 100644 --- a/scripts/v.rast.stats/testsuite/test_v_rast_stats.py +++ b/scripts/v.rast.stats/testsuite/test_v_rast_stats.py @@ -5,6 +5,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows from grass.pygrass.vector import VectorTopo from grass.pygrass.vector.geometry import Line from grass.pygrass.vector.geometry import Boundary @@ -71,6 +72,7 @@ def setUp(self): vt.table.conn.commit() vt.close() + @xfail_windows def test_1(self): # Output of v.rast.stats univar_string = """cat|value|label|a_minimum|a_maximum|a_sum @@ -91,6 +93,7 @@ def test_1(self): self.runModule(v_db_select) self.assertLooksLike(univar_string, str(v_db_select.outputs.stdout)) + @xfail_windows def test_line_d(self): output_str = """cat|name|a_median|a_number|a_range 1|first|192|3|1 @@ -109,6 +112,7 @@ def test_line_d(self): self.runModule(v_db_select) self.assertLooksLike(output_str, str(v_db_select.outputs.stdout)) + @xfail_windows def test_line(self): output_str = """cat|name|a_median|a_number|a_range 1|first|192|5|2 @@ -128,6 +132,7 @@ def test_line(self): self.runModule(v_db_select) self.assertLooksLike(output_str, str(v_db_select.outputs.stdout)) + @xfail_windows def test_zone_all(self): # Output of v.rast.stats univar_string = """cat|value|label|a_number|a_null_cells|a_minimum|a_maximum|a_range|a_average|a_stddev|a_variance|a_coeff_var|a_sum|a_first_quartile|a_median|a_third_quartile|a_percentile_90 @@ -143,6 +148,7 @@ def test_zone_all(self): self.runModule(v_db_select) self.assertLooksLike(univar_string, str(v_db_select.outputs.stdout)) + @xfail_windows def test_small_area_with_centroid(self): # Output of v.rast.stats univar_string = """cat|name|a_number|a_null_cells|a_minimum|a_maximum|a_range|a_average|a_stddev|a_variance|a_coeff_var|a_sum|a_first_quartile|a_median|a_third_quartile|a_percentile_90 diff --git a/temporal/t.rast.gapfill/testsuite/test_gapfill.py b/temporal/t.rast.gapfill/testsuite/test_gapfill.py index 63cd2b83c26..7b083617d08 100644 --- a/temporal/t.rast.gapfill/testsuite/test_gapfill.py +++ b/temporal/t.rast.gapfill/testsuite/test_gapfill.py @@ -12,6 +12,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows class TestRasterToVector(TestCase): @@ -75,6 +76,7 @@ def tearDown(self): """Remove generated data""" self.runModule("t.remove", flags="df", type="strds", inputs="A") + @xfail_windows def test_simple_2procs(self): self.assertModule( "t.rast.gapfill", @@ -125,6 +127,7 @@ def test_simple_2procs(self): self.assertModule(rast_list) self.assertLooksLike(text, rast_list.outputs.stdout) + @xfail_windows def test_simple_where(self): self.assertModule( "t.rast.gapfill", @@ -173,6 +176,7 @@ def test_simple_where(self): self.assertModule(rast_list) self.assertLooksLike(text, rast_list.outputs.stdout) + @xfail_windows def test_simple_where_2(self): self.assertModule( "t.rast.gapfill", @@ -216,6 +220,7 @@ def test_simple_where_2(self): self.assertModule(rast_list) self.assertLooksLike(text, rast_list.outputs.stdout) + @xfail_windows def test_simple_empty(self): self.assertModule( "t.rast.gapfill", @@ -302,6 +307,7 @@ def test_simple_gran(self): self.assertModule(rast_list) self.assertLooksLike(text, rast_list.outputs.stdout) + @xfail_windows def test_simple_gran(self): self.assertModule( "t.rast.gapfill", diff --git a/temporal/t.rast.univar/testsuite/test_t_rast_univar.py b/temporal/t.rast.univar/testsuite/test_t_rast_univar.py index 11a91614b6c..1f992a9d39e 100644 --- a/temporal/t.rast.univar/testsuite/test_t_rast_univar.py +++ b/temporal/t.rast.univar/testsuite/test_t_rast_univar.py @@ -11,6 +11,7 @@ from pathlib import Path from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows class TestRasterUnivar(TestCase): @@ -152,6 +153,7 @@ def tearDownClass(cls): cls.del_temp_region() + @xfail_windows def test_with_all_maps(self): t_rast_univar = SimpleModule( "t.rast.univar", @@ -201,6 +203,7 @@ def test_with_subset_of_maps(self): res_line = res.split("|", 1)[1] self.assertLooksLike(ref_line, res_line) + @xfail_windows def test_coarser_resolution(self): t_rast_univar = SimpleModule( "t.rast.univar", @@ -316,6 +319,7 @@ def test_error_handling_no_input(self): # No input self.assertModuleFail("t.rast.univar", output="out.txt") + @xfail_windows def test_with_zones(self): """Test use of zones""" @@ -353,6 +357,7 @@ def test_with_zones(self): res_line = res.split("|", 1)[1] self.assertLooksLike(ref_line, res_line) + @xfail_windows def test_with_semantic_label(self): """Test semantic labels""" t_rast_univar = SimpleModule( @@ -379,6 +384,7 @@ def test_with_semantic_label(self): res_line = res.split("|", 1)[1] self.assertLooksLike(ref_line, res_line) + @xfail_windows def test_with_semantic_label_parallel(self): """Test semantic labels""" t_rast_univar = SimpleModule( @@ -406,6 +412,7 @@ def test_with_semantic_label_parallel(self): res_line = res.split("|", 1)[1] self.assertLooksLike(ref_line, res_line) + @xfail_windows def test_with_spatial_filter_intersects(self): """Test spatial filter overlaps""" t_rast_univar = SimpleModule( @@ -434,6 +441,7 @@ def test_with_spatial_filter_intersects(self): res_line = res.split("|", 1)[1] self.assertLooksLike(ref_line, res_line) + @xfail_windows def test_with_spatial_filter_contains(self): """Test spatial filter contains""" t_rast_univar = SimpleModule( @@ -460,6 +468,7 @@ def test_with_spatial_filter_contains(self): res_line = res.split("|", 1)[1] self.assertLooksLike(ref_line, res_line) + @xfail_windows def test_with_spatial_filter_is_contained(self): """Test spatial filter is_contained""" t_rast_univar = SimpleModule( diff --git a/temporal/t.rast.what/testsuite/test_what.py b/temporal/t.rast.what/testsuite/test_what.py index 96432eff4e1..18c7af63807 100644 --- a/temporal/t.rast.what/testsuite/test_what.py +++ b/temporal/t.rast.what/testsuite/test_what.py @@ -10,6 +10,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows class TestRasterWhat(TestCase): @@ -218,6 +219,7 @@ def test_timerow_output_coords(self): "out_timerow_coords.txt", "ca4ee0e7e4aaca170d6034e0d57d292d", text=True ) + @xfail_windows def test_row_stdout_where_parallel(self): t_rast_what = SimpleModule( "t.rast.what", @@ -245,6 +247,7 @@ def test_row_stdout_where_parallel(self): """ self.assertLooksLike(text, str(t_rast_what.outputs.stdout)) + @xfail_windows def test_row_stdout_where_parallel_cat(self): t_rast_what = SimpleModule( "t.rast.what", @@ -272,6 +275,7 @@ def test_row_stdout_where_parallel_cat(self): """ self.assertLooksLike(text, str(t_rast_what.outputs.stdout)) + @xfail_windows def test_row_stdout_where_parallel2(self): """Here without output definition, the default is used then""" @@ -385,6 +389,7 @@ def tearDownClass(cls): cls.runModule("t.remove", flags="df", type="strds", inputs="A") cls.del_temp_region() + @xfail_windows def test_null_value(self): """Test setting the null value""" diff --git a/temporal/t.rast3d.univar/testsuite/test_t_rast3d_univar.py b/temporal/t.rast3d.univar/testsuite/test_t_rast3d_univar.py index 7c8ab1e4100..4ca64e88442 100644 --- a/temporal/t.rast3d.univar/testsuite/test_t_rast3d_univar.py +++ b/temporal/t.rast3d.univar/testsuite/test_t_rast3d_univar.py @@ -11,6 +11,7 @@ from pathlib import Path from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows class TestRasterUnivar(TestCase): @@ -58,6 +59,7 @@ def tearDownClass(cls): cls.runModule("g.remove", flags="f", type="raster_3d", name="zones") cls.del_temp_region() + @xfail_windows def test_with_all_maps(self): t_rast3d_univar = SimpleModule( "t.rast3d.univar", @@ -82,6 +84,7 @@ def test_with_all_maps(self): res_line = res.split("|", 1)[1] self.assertLooksLike(ref_line, res_line) + @xfail_windows def test_with_subset_of_maps(self): t_rast3d_univar = SimpleModule( "t.rast3d.univar", @@ -166,6 +169,7 @@ def test_error_handling_no_input(self): # No input self.assertModuleFail("t.rast3d.univar", output="out.txt") + @xfail_windows def test_with_zones(self): """Test use of zones""" @@ -203,6 +207,7 @@ def test_with_zones(self): res_line = res.split("|", 1)[1] self.assertLooksLike(ref_line, res_line) + @xfail_windows def test_with_zones_parallel(self): """Test use of zones""" From b2f71f68ce341c6d8ad7bd57f2f7da24a25bad68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:24:00 +0000 Subject: [PATCH 15/42] tests: Apply xfail_windows decorator to setUpClass in lib/gis getl tests --- lib/gis/testsuite/test_gis_lib_getl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gis/testsuite/test_gis_lib_getl.py b/lib/gis/testsuite/test_gis_lib_getl.py index 8dca35de496..7c7c5d954ed 100644 --- a/lib/gis/testsuite/test_gis_lib_getl.py +++ b/lib/gis/testsuite/test_gis_lib_getl.py @@ -14,10 +14,10 @@ from grass.gunittest.utils import xfail_windows -@xfail_windows class TestNewlinesWithGetlFunctions(TestCase): """Test C functions G_getl() and G_getl2() from gis library""" + @xfail_windows @classmethod def setUpClass(cls): cls.libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library("c")) From 7c0773da186ff21732a3c60a76376be08d65298d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:24:55 +0000 Subject: [PATCH 16/42] tests: Apply xfail_windows decorator to parser json tests in lib/gis --- lib/gis/testsuite/test_parser_json.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/gis/testsuite/test_parser_json.py b/lib/gis/testsuite/test_parser_json.py index 918fb453d04..74ff9673c7f 100644 --- a/lib/gis/testsuite/test_parser_json.py +++ b/lib/gis/testsuite/test_parser_json.py @@ -10,11 +10,14 @@ import subprocess from grass.gunittest.case import TestCase +from grass.gunittest.utils import xfail_windows from grass.script import decode import json class TestParserJson(TestCase): + + @xfail_windows def test_r_slope_aspect_json(self): args = [ "r.slope.aspect", @@ -58,6 +61,7 @@ def test_r_slope_aspect_json(self): self.assertEqual(json_code["inputs"], inputs) self.assertEqual(json_code["outputs"], outputs) + @xfail_windows def test_v_out_ascii(self): args = [ "v.out.ascii", @@ -91,6 +95,7 @@ def test_v_out_ascii(self): self.assertEqual(json_code["inputs"], inputs) self.assertEqual(json_code["outputs"], outputs) + @xfail_windows def test_v_info(self): args = ["v.info", "map=hospitals@PERMANENT", "-c", "--json"] From 9d370b7e37e0d0f528e9ee6b2007e5d86d4e39ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:29:42 +0000 Subject: [PATCH 17/42] tests: Apply xfail_windows decorator to failing test in lib/imagery --- lib/imagery/testsuite/test_imagery_signature_management.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/imagery/testsuite/test_imagery_signature_management.py b/lib/imagery/testsuite/test_imagery_signature_management.py index 186a64c797b..42c55c45123 100644 --- a/lib/imagery/testsuite/test_imagery_signature_management.py +++ b/lib/imagery/testsuite/test_imagery_signature_management.py @@ -51,6 +51,7 @@ def test_get_sig(self): I_get_signatures_dir(cdir, I_SIGFILE_TYPE_SIG) self.assertEqual(utils.decode(cdir.value), f"signatures{HOST_DIRSEP}sig") + @xfail_windows def test_get_sigset(self): cdir = ctypes.create_string_buffer(GNAME_MAX) I_get_signatures_dir(cdir, I_SIGFILE_TYPE_SIGSET) From 9e764d0eb813dab829dd698e865c25995b7243fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:33:48 +0000 Subject: [PATCH 18/42] Remove wrong import of xfail_windows --- scripts/g.extension/testsuite/test_addons_toolboxes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/g.extension/testsuite/test_addons_toolboxes.py b/scripts/g.extension/testsuite/test_addons_toolboxes.py index dfca44a5c02..17d7e4b5b74 100644 --- a/scripts/g.extension/testsuite/test_addons_toolboxes.py +++ b/scripts/g.extension/testsuite/test_addons_toolboxes.py @@ -19,7 +19,6 @@ import os -from python.grass.gunittest.utils import xfail_windows FULL_TOOLBOXES_OUTPUT = """\ Hydrology (HY) From 20eb947d4cc0f1b2f79ffb9e16541fcb94d59a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:42:30 +0000 Subject: [PATCH 19/42] tests: Temporarily remove all gunittest exclusions --- .gunittest.cfg | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.gunittest.cfg b/.gunittest.cfg index 01b06c78913..defbc7ad0f1 100644 --- a/.gunittest.cfg +++ b/.gunittest.cfg @@ -4,36 +4,36 @@ # space. This would be ideally empty or it would include just special cases, # but it includes mainly tests which can (and should) be fixed. exclude = - gui/wxpython/core/testsuite/test_gcmd.py - gui/wxpython/core/testsuite/toolboxes.sh - lib/init/testsuite/test_grass_tmp_mapset.py - python/grass/gunittest/testsuite/test_assertions_rast3d.py - python/grass/gunittest/testsuite/test_assertions_vect.py - python/grass/gunittest/testsuite/test_gmodules.py - python/grass/gunittest/testsuite/test_gunitest_doctests.py - python/grass/pygrass/raster/testsuite/test_pygrass_raster_doctests.py - python/grass/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py - python/grass/script/testsuite/test_script_doctests.py - python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py - python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py - raster/r.in.lidar/testsuite/test_base_resolution.sh - raster/r.in.lidar/testsuite/test_base_resolution.sh - scripts/g.search.modules/testsuite/test_g_search_modules.py - temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py - temporal/t.connect/testsuite/test_distr_tgis_db_raster.py - temporal/t.connect/testsuite/test_distr_tgis_db_vector.py - temporal/t.info/testsuite/test.t.info.sh - temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py - temporal/t.rast.series/testsuite/test_series.py - vector/v.in.lidar/testsuite/decimation_test.py - vector/v.in.lidar/testsuite/mask_test.py - vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py - vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py - vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py - vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py - vector/v.out.lidar/testsuite/test_v_out_lidar.py - vector/v.what/testsuite/test_vwhat_layers.py - vector/v.what/testsuite/test_vwhat_ncspm.py + # gui/wxpython/core/testsuite/test_gcmd.py + # gui/wxpython/core/testsuite/toolboxes.sh + # lib/init/testsuite/test_grass_tmp_mapset.py + # python/grass/gunittest/testsuite/test_assertions_rast3d.py + # python/grass/gunittest/testsuite/test_assertions_vect.py + # python/grass/gunittest/testsuite/test_gmodules.py + # python/grass/gunittest/testsuite/test_gunitest_doctests.py + # python/grass/pygrass/raster/testsuite/test_pygrass_raster_doctests.py + # python/grass/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py + # python/grass/script/testsuite/test_script_doctests.py + # python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py + # python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py + # raster/r.in.lidar/testsuite/test_base_resolution.sh + # raster/r.in.lidar/testsuite/test_base_resolution.sh + # scripts/g.search.modules/testsuite/test_g_search_modules.py + # temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py + # temporal/t.connect/testsuite/test_distr_tgis_db_raster.py + # temporal/t.connect/testsuite/test_distr_tgis_db_vector.py + # temporal/t.info/testsuite/test.t.info.sh + # temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py + # temporal/t.rast.series/testsuite/test_series.py + # vector/v.in.lidar/testsuite/decimation_test.py + # vector/v.in.lidar/testsuite/mask_test.py + # vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py + # vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py + # vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py + # vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py + # vector/v.out.lidar/testsuite/test_v_out_lidar.py + # vector/v.what/testsuite/test_vwhat_layers.py + # vector/v.what/testsuite/test_vwhat_ncspm.py # Maximum time for execution of one test file (not a test function) # after which test is terminated (which may not terminate child processes From d55ba68d96c656f7dd6f5805888fdcfa7cd0dcdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:26:04 +0000 Subject: [PATCH 20/42] tests: Apply xfail_windows decorator to failing test in test_gcmd.py --- gui/wxpython/core/testsuite/test_gcmd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gui/wxpython/core/testsuite/test_gcmd.py b/gui/wxpython/core/testsuite/test_gcmd.py index 121ede99b77..75d3bf5932b 100644 --- a/gui/wxpython/core/testsuite/test_gcmd.py +++ b/gui/wxpython/core/testsuite/test_gcmd.py @@ -1,5 +1,6 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows class Rcv: @@ -16,6 +17,8 @@ def recv(self): class Recv_SomeTest(TestCase): + + @xfail_windows def test_decode(self): """ Multibyte chars should not be split From 960befe40f30cb95eba26dae2fe457eb4689be1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:26:39 +0000 Subject: [PATCH 21/42] tests: Apply xfail_windows decorator to failing test in lib/init in test_grass_tmp_mapset.py --- lib/init/testsuite/test_grass_tmp_mapset.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/init/testsuite/test_grass_tmp_mapset.py b/lib/init/testsuite/test_grass_tmp_mapset.py index 7a488dadb5f..bf142a4117d 100644 --- a/lib/init/testsuite/test_grass_tmp_mapset.py +++ b/lib/init/testsuite/test_grass_tmp_mapset.py @@ -18,7 +18,7 @@ import os import shutil import subprocess - +from grass.gunittest.utils import xfail_windows # Note that unlike rest of GRASS GIS, here we are using unittest package # directly. The grass.gunittest machinery for mapsets is not needed here. @@ -43,6 +43,7 @@ def tearDown(self): """Deletes the location""" shutil.rmtree(self.location, ignore_errors=True) + @xfail_windows def test_command_runs(self): """Check that correct parameters are accepted""" return_code = subprocess.call( @@ -57,6 +58,7 @@ def test_command_runs(self): ), ) + @xfail_windows def test_command_fails_without_location(self): """Check that the command fails with a nonexistent location""" return_code = subprocess.call( @@ -78,6 +80,7 @@ def test_command_fails_without_location(self): ), ) + @xfail_windows def test_mapset_metadata_correct(self): """Check that metadata is readable and have expected value (XY CRS)""" output = subprocess.check_output( @@ -91,6 +94,7 @@ def test_mapset_metadata_correct(self): ), ) + @xfail_windows def test_mapset_deleted(self): """Check that mapset is deleted at the end of execution""" subprocess.check_call( From e33dfce911d586a45113a0acfa44e8f66dae3b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:27:33 +0000 Subject: [PATCH 22/42] CI(OSGeo4W): Use an OSGeo4W-specific gunittest.cfg config file --- .github/workflows/osgeo4w_gunittest.cfg | 43 +++++++++++++++++++++++++ .github/workflows/test_thorough.bat | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/osgeo4w_gunittest.cfg diff --git a/.github/workflows/osgeo4w_gunittest.cfg b/.github/workflows/osgeo4w_gunittest.cfg new file mode 100644 index 00000000000..01b06c78913 --- /dev/null +++ b/.github/workflows/osgeo4w_gunittest.cfg @@ -0,0 +1,43 @@ +[gunittest] + +# Files (or wildcard patterns) to exclude from testing separated by newline or +# space. This would be ideally empty or it would include just special cases, +# but it includes mainly tests which can (and should) be fixed. +exclude = + gui/wxpython/core/testsuite/test_gcmd.py + gui/wxpython/core/testsuite/toolboxes.sh + lib/init/testsuite/test_grass_tmp_mapset.py + python/grass/gunittest/testsuite/test_assertions_rast3d.py + python/grass/gunittest/testsuite/test_assertions_vect.py + python/grass/gunittest/testsuite/test_gmodules.py + python/grass/gunittest/testsuite/test_gunitest_doctests.py + python/grass/pygrass/raster/testsuite/test_pygrass_raster_doctests.py + python/grass/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py + python/grass/script/testsuite/test_script_doctests.py + python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py + python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py + raster/r.in.lidar/testsuite/test_base_resolution.sh + raster/r.in.lidar/testsuite/test_base_resolution.sh + scripts/g.search.modules/testsuite/test_g_search_modules.py + temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py + temporal/t.connect/testsuite/test_distr_tgis_db_raster.py + temporal/t.connect/testsuite/test_distr_tgis_db_vector.py + temporal/t.info/testsuite/test.t.info.sh + temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py + temporal/t.rast.series/testsuite/test_series.py + vector/v.in.lidar/testsuite/decimation_test.py + vector/v.in.lidar/testsuite/mask_test.py + vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py + vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py + vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py + vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py + vector/v.out.lidar/testsuite/test_v_out_lidar.py + vector/v.what/testsuite/test_vwhat_layers.py + vector/v.what/testsuite/test_vwhat_ncspm.py + +# Maximum time for execution of one test file (not a test function) +# after which test is terminated (which may not terminate child processes +# from that test). +# Using 5 minutes as maximum (average test time should be much shorter, +# couple seconds per file, median should be around one second). +timeout = 300 diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index 40df9534a20..b26a085e95b 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -2,4 +2,4 @@ set grass=%1 set python=%2 call %grass% --tmp-project XY --exec g.download.project url=https://grass.osgeo.org/sampledata/north_carolina/nc_spm_full_v2alpha2.tar.gz path=%USERPROFILE% -call %grass% --tmp-project XY --exec %python% -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 86 +call %grass% --tmp-project XY --exec %python% -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 86 --config .github\workflows\osgeo4w_gunittest.cfg From c9599fcc7ae11c873a63a96ae7b68c7f1871399e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:29:33 +0000 Subject: [PATCH 23/42] Revert "tests: Temporarily remove all gunittest exclusions" This reverts commit 20eb947d4cc0f1b2f79ffb9e16541fcb94d59a9a. --- .gunittest.cfg | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.gunittest.cfg b/.gunittest.cfg index defbc7ad0f1..01b06c78913 100644 --- a/.gunittest.cfg +++ b/.gunittest.cfg @@ -4,36 +4,36 @@ # space. This would be ideally empty or it would include just special cases, # but it includes mainly tests which can (and should) be fixed. exclude = - # gui/wxpython/core/testsuite/test_gcmd.py - # gui/wxpython/core/testsuite/toolboxes.sh - # lib/init/testsuite/test_grass_tmp_mapset.py - # python/grass/gunittest/testsuite/test_assertions_rast3d.py - # python/grass/gunittest/testsuite/test_assertions_vect.py - # python/grass/gunittest/testsuite/test_gmodules.py - # python/grass/gunittest/testsuite/test_gunitest_doctests.py - # python/grass/pygrass/raster/testsuite/test_pygrass_raster_doctests.py - # python/grass/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py - # python/grass/script/testsuite/test_script_doctests.py - # python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py - # python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py - # raster/r.in.lidar/testsuite/test_base_resolution.sh - # raster/r.in.lidar/testsuite/test_base_resolution.sh - # scripts/g.search.modules/testsuite/test_g_search_modules.py - # temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py - # temporal/t.connect/testsuite/test_distr_tgis_db_raster.py - # temporal/t.connect/testsuite/test_distr_tgis_db_vector.py - # temporal/t.info/testsuite/test.t.info.sh - # temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py - # temporal/t.rast.series/testsuite/test_series.py - # vector/v.in.lidar/testsuite/decimation_test.py - # vector/v.in.lidar/testsuite/mask_test.py - # vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py - # vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py - # vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py - # vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py - # vector/v.out.lidar/testsuite/test_v_out_lidar.py - # vector/v.what/testsuite/test_vwhat_layers.py - # vector/v.what/testsuite/test_vwhat_ncspm.py + gui/wxpython/core/testsuite/test_gcmd.py + gui/wxpython/core/testsuite/toolboxes.sh + lib/init/testsuite/test_grass_tmp_mapset.py + python/grass/gunittest/testsuite/test_assertions_rast3d.py + python/grass/gunittest/testsuite/test_assertions_vect.py + python/grass/gunittest/testsuite/test_gmodules.py + python/grass/gunittest/testsuite/test_gunitest_doctests.py + python/grass/pygrass/raster/testsuite/test_pygrass_raster_doctests.py + python/grass/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py + python/grass/script/testsuite/test_script_doctests.py + python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py + python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py + raster/r.in.lidar/testsuite/test_base_resolution.sh + raster/r.in.lidar/testsuite/test_base_resolution.sh + scripts/g.search.modules/testsuite/test_g_search_modules.py + temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py + temporal/t.connect/testsuite/test_distr_tgis_db_raster.py + temporal/t.connect/testsuite/test_distr_tgis_db_vector.py + temporal/t.info/testsuite/test.t.info.sh + temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py + temporal/t.rast.series/testsuite/test_series.py + vector/v.in.lidar/testsuite/decimation_test.py + vector/v.in.lidar/testsuite/mask_test.py + vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py + vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py + vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py + vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py + vector/v.out.lidar/testsuite/test_v_out_lidar.py + vector/v.what/testsuite/test_vwhat_layers.py + vector/v.what/testsuite/test_vwhat_ncspm.py # Maximum time for execution of one test file (not a test function) # after which test is terminated (which may not terminate child processes From 2221cbc172ec80420478afd7a8b6a17b0d78668e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:33:33 +0000 Subject: [PATCH 24/42] v.out.lidar: Apply xfail_windows decorator to one failing test --- vector/v.out.lidar/testsuite/test_v_out_lidar.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vector/v.out.lidar/testsuite/test_v_out_lidar.py b/vector/v.out.lidar/testsuite/test_v_out_lidar.py index 9be4f57d3b6..613cb14b61a 100644 --- a/vector/v.out.lidar/testsuite/test_v_out_lidar.py +++ b/vector/v.out.lidar/testsuite/test_v_out_lidar.py @@ -12,6 +12,7 @@ import os from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows class BasicTest(TestCase): @@ -60,6 +61,7 @@ def test_module_runs_output_created(self): self.assertModule("v.out.lidar", input=self.vector_points, output=self.las_file) self.assertFileExists(self.las_file) + @xfail_windows def test_output_identical(self): """Test to see if the standard outputs are created From a49957309f6cf32a40fc29ea2e538c05cbffe110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:37:01 +0000 Subject: [PATCH 25/42] t.rast.series: Apply xfail_windows decorator to failing tests --- temporal/t.rast.series/testsuite/test_series.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/temporal/t.rast.series/testsuite/test_series.py b/temporal/t.rast.series/testsuite/test_series.py index cfb17a338cd..8070b4de44b 100644 --- a/temporal/t.rast.series/testsuite/test_series.py +++ b/temporal/t.rast.series/testsuite/test_series.py @@ -14,6 +14,7 @@ import grass.temporal as tgis from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows class TestSnapAbsoluteSTRDS(TestCase): @@ -66,6 +67,7 @@ def tearDownClass(cls): cls.runModule("g.remove", flags="f", type="raster", name="series_minimum_2") cls.runModule("g.remove", flags="f", type="raster", name="series_quantile") + @xfail_windows def test_time_stamp(self): self.assertModule( "t.rast.series", @@ -146,6 +148,7 @@ def test_minimum_where(self): map="series_minimum_2", refmin=300, refmax=300, msg="Minimum must be 300" ) + @xfail_windows def test_quantile(self): self.assertModule( "t.rast.series", From 2dc4d8050429f0785e39e05a27b77e2a495e94b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:42:15 +0000 Subject: [PATCH 26/42] t.connect: Apply xfail_windows decorator to three failing tests --- temporal/t.connect/testsuite/test_distr_tgis_db_raster.py | 3 ++- temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py | 3 ++- temporal/t.connect/testsuite/test_distr_tgis_db_vector.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py b/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py index 412a926f01d..6e4d76b26c5 100644 --- a/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py +++ b/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py @@ -13,7 +13,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule -from grass.gunittest.utils import silent_rmtree +from grass.gunittest.utils import silent_rmtree, xfail_windows class TestRasterExtraction(TestCase): @@ -254,6 +254,7 @@ def test_strds_info(self): module=info, reference=tinfo_string, precision=2, sep="=" ) + @xfail_windows def test_raster_info(self): self.runModule("g.mapset", mapset="test3") tinfo_string = """id=a1@test1 diff --git a/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py b/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py index 23bc11c271e..f9b4df76d88 100644 --- a/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py +++ b/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py @@ -13,7 +13,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule -from grass.gunittest.utils import silent_rmtree +from grass.gunittest.utils import silent_rmtree, xfail_windows class testRaster3dExtraction(TestCase): @@ -242,6 +242,7 @@ def test_strds_info(self): module=info, reference=tinfo_string, precision=2, sep="=" ) + @xfail_windows def test_raster_info(self): self.runModule("g.mapset", mapset="test3d3") tinfo_string = """id=a1@test3d1 diff --git a/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py b/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py index fd26cc93e26..7184fd32cb5 100644 --- a/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py +++ b/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py @@ -13,7 +13,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule -from grass.gunittest.utils import silent_rmtree +from grass.gunittest.utils import silent_rmtree, xfail_windows class TestRasterExtraction(TestCase): @@ -259,6 +259,7 @@ def test_stvds_info(self): module=info, reference=tinfo_string, precision=2, sep="=" ) + @xfail_windows def testv_vector_info(self): self.runModule("g.mapset", mapset="testvect3") tinfo_string = """id=a1@testvect1 From 9fff0efb2b715197c17c133d75adee478dc87e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:44:09 +0000 Subject: [PATCH 27/42] g.search.modules: Apply xfail_windows decorator to a failing test --- scripts/g.search.modules/testsuite/test_g_search_modules.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/g.search.modules/testsuite/test_g_search_modules.py b/scripts/g.search.modules/testsuite/test_g_search_modules.py index d280ffc1441..75537eb8d78 100644 --- a/scripts/g.search.modules/testsuite/test_g_search_modules.py +++ b/scripts/g.search.modules/testsuite/test_g_search_modules.py @@ -15,6 +15,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows from grass.script.utils import decode import unittest @@ -65,6 +66,7 @@ def test_colored_terminal(self): stdout = decode(module.outputs.stdout).split() self.assertEqual(stdout[0], termcolor.colored("r.basins.fill", attrs=["bold"])) + @xfail_windows def test_manual_pages(self): module = SimpleModule("g.search.modules", keyword="kapri", flags="gm") self.assertModule(module) From 1c5a426b7f41cf698cd4ebb3d27025b2e39e054d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:46:57 +0000 Subject: [PATCH 28/42] grass.temporal: Apply xfail_windows decorator to failing tests in unittests_temporal_raster_algebra_equal_ts --- .../testsuite/unittests_temporal_raster_algebra_equal_ts.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py b/python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py index 92397cd825c..f96ed12899f 100644 --- a/python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py +++ b/python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py @@ -12,6 +12,7 @@ import grass.temporal as tgis from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows class TestTemporalRasterAlgebraImplicitAggregation(TestCase): @@ -64,6 +65,7 @@ def tearDownClass(cls): cls.runModule("t.unregister", maps="singletmap", quiet=True) cls.del_temp_region() + @xfail_windows def test_simple_operator(self): """Test implicit aggregation @@ -149,6 +151,7 @@ def test_single_map_complex_operator(self): self.assertEqual(D.check_temporal_topology(), True) self.assertEqual(D.get_granularity(), None) + @xfail_windows def test_single_map_simple_operator(self): """Test implicit aggregation From 3a30a57d17761af170def3e2aca94b463258dc64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:51:28 +0000 Subject: [PATCH 29/42] grass.gunittest: Apply xfail_windows decorator to failing test test_assertVectorEqualsAscii_by_import --- python/grass/gunittest/testsuite/test_assertions_vect.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/grass/gunittest/testsuite/test_assertions_vect.py b/python/grass/gunittest/testsuite/test_assertions_vect.py index 8b3288ad2ca..0a73580ba58 100644 --- a/python/grass/gunittest/testsuite/test_assertions_vect.py +++ b/python/grass/gunittest/testsuite/test_assertions_vect.py @@ -5,6 +5,7 @@ from grass.exceptions import CalledModuleError from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows V_UNIVAR_SCHOOLS_WIDTH_SUBSET = """n=144 @@ -281,6 +282,7 @@ def test_assertVectorAsciiEqualsVectorAscii_diff_content(self): self.assertFileExists(self.simple_base_file) self.assertFileExists(self.simple_modified_file) + @xfail_windows def test_assertVectorEqualsAscii_by_import(self): amap = "simple_vector_map_imported_base" self.runModule( From aa3ff5e6d050f503947195a69d0d57243a419e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:52:12 +0000 Subject: [PATCH 30/42] tests: Re-enable excluded tests that are not failing on Windows --- .github/workflows/osgeo4w_gunittest.cfg | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/osgeo4w_gunittest.cfg b/.github/workflows/osgeo4w_gunittest.cfg index 01b06c78913..22a5febe630 100644 --- a/.github/workflows/osgeo4w_gunittest.cfg +++ b/.github/workflows/osgeo4w_gunittest.cfg @@ -4,34 +4,19 @@ # space. This would be ideally empty or it would include just special cases, # but it includes mainly tests which can (and should) be fixed. exclude = - gui/wxpython/core/testsuite/test_gcmd.py gui/wxpython/core/testsuite/toolboxes.sh - lib/init/testsuite/test_grass_tmp_mapset.py - python/grass/gunittest/testsuite/test_assertions_rast3d.py - python/grass/gunittest/testsuite/test_assertions_vect.py - python/grass/gunittest/testsuite/test_gmodules.py + # lib/init/testsuite/test_grass_tmp_mapset.py python/grass/gunittest/testsuite/test_gunitest_doctests.py python/grass/pygrass/raster/testsuite/test_pygrass_raster_doctests.py python/grass/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py - python/grass/script/testsuite/test_script_doctests.py - python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py + # python/grass/script/testsuite/test_script_doctests.py python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py - raster/r.in.lidar/testsuite/test_base_resolution.sh - raster/r.in.lidar/testsuite/test_base_resolution.sh - scripts/g.search.modules/testsuite/test_g_search_modules.py - temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py - temporal/t.connect/testsuite/test_distr_tgis_db_raster.py - temporal/t.connect/testsuite/test_distr_tgis_db_vector.py temporal/t.info/testsuite/test.t.info.sh temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py - temporal/t.rast.series/testsuite/test_series.py vector/v.in.lidar/testsuite/decimation_test.py vector/v.in.lidar/testsuite/mask_test.py vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py - vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py - vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py - vector/v.out.lidar/testsuite/test_v_out_lidar.py vector/v.what/testsuite/test_vwhat_layers.py vector/v.what/testsuite/test_vwhat_ncspm.py From 2d488eeb6e1e2b6e6590741719eee8920c640e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:58:35 +0000 Subject: [PATCH 31/42] tests: Re-enable passing tests from .gunittest.cfg exclusion list --- .gunittest.cfg | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.gunittest.cfg b/.gunittest.cfg index 01b06c78913..be5d3760cdb 100644 --- a/.gunittest.cfg +++ b/.gunittest.cfg @@ -4,12 +4,8 @@ # space. This would be ideally empty or it would include just special cases, # but it includes mainly tests which can (and should) be fixed. exclude = - gui/wxpython/core/testsuite/test_gcmd.py gui/wxpython/core/testsuite/toolboxes.sh - lib/init/testsuite/test_grass_tmp_mapset.py - python/grass/gunittest/testsuite/test_assertions_rast3d.py python/grass/gunittest/testsuite/test_assertions_vect.py - python/grass/gunittest/testsuite/test_gmodules.py python/grass/gunittest/testsuite/test_gunitest_doctests.py python/grass/pygrass/raster/testsuite/test_pygrass_raster_doctests.py python/grass/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py @@ -17,8 +13,6 @@ exclude = python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py raster/r.in.lidar/testsuite/test_base_resolution.sh - raster/r.in.lidar/testsuite/test_base_resolution.sh - scripts/g.search.modules/testsuite/test_g_search_modules.py temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py temporal/t.connect/testsuite/test_distr_tgis_db_raster.py temporal/t.connect/testsuite/test_distr_tgis_db_vector.py From e14e3b240e5c5abc7dcb05c638cfa6c415a67c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 11:48:41 -0400 Subject: [PATCH 32/42] Update test_gis_lib_getl.py --- lib/gis/testsuite/test_gis_lib_getl.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/gis/testsuite/test_gis_lib_getl.py b/lib/gis/testsuite/test_gis_lib_getl.py index 7c7c5d954ed..98092955ab2 100644 --- a/lib/gis/testsuite/test_gis_lib_getl.py +++ b/lib/gis/testsuite/test_gis_lib_getl.py @@ -11,13 +11,11 @@ import grass.lib.gis as libgis from grass.gunittest.case import TestCase from grass.gunittest.main import test -from grass.gunittest.utils import xfail_windows class TestNewlinesWithGetlFunctions(TestCase): """Test C functions G_getl() and G_getl2() from gis library""" - @xfail_windows @classmethod def setUpClass(cls): cls.libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library("c")) From 362e9fe8b1ec976f8ebf37747e4efb489300e8ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 11:50:09 -0400 Subject: [PATCH 33/42] Update test_raster_img.py --- python/grass/pygrass/raster/testsuite/test_raster_img.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/grass/pygrass/raster/testsuite/test_raster_img.py b/python/grass/pygrass/raster/testsuite/test_raster_img.py index 9840411f337..b873b16a86b 100644 --- a/python/grass/pygrass/raster/testsuite/test_raster_img.py +++ b/python/grass/pygrass/raster/testsuite/test_raster_img.py @@ -5,7 +5,6 @@ from grass.gunittest.main import test from grass.gunittest.utils import xfail_windows - from grass.pygrass.raster import raster2numpy_img from grass.pygrass.gis.region import Region from grass.script.core import tempfile From 10a7d67ccfb2786be7605673f6a06d3d058fee24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:59:53 +0000 Subject: [PATCH 34/42] tests: Try re-enabling python/grass/script/testsuite/test_script_doctests.py --- .gunittest.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gunittest.cfg b/.gunittest.cfg index be5d3760cdb..1db569a910c 100644 --- a/.gunittest.cfg +++ b/.gunittest.cfg @@ -9,7 +9,7 @@ exclude = python/grass/gunittest/testsuite/test_gunitest_doctests.py python/grass/pygrass/raster/testsuite/test_pygrass_raster_doctests.py python/grass/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py - python/grass/script/testsuite/test_script_doctests.py + # python/grass/script/testsuite/test_script_doctests.py python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py raster/r.in.lidar/testsuite/test_base_resolution.sh From 410819216aecf774b8420a8d3e246b8b307cb9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 18:44:31 +0000 Subject: [PATCH 35/42] i.maxlik: Add xfail_windows decorator to all tests in class --- imagery/i.maxlik/testsuite/test_i_maxlik.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imagery/i.maxlik/testsuite/test_i_maxlik.py b/imagery/i.maxlik/testsuite/test_i_maxlik.py index 552d8e00328..e7fbf6c1a79 100644 --- a/imagery/i.maxlik/testsuite/test_i_maxlik.py +++ b/imagery/i.maxlik/testsuite/test_i_maxlik.py @@ -37,7 +37,6 @@ ) -@xfail_windows class SuccessTest(TestCase): """Test successful classification""" @@ -174,6 +173,7 @@ def tearDownClass(cls): ) cls.runModule("g.remove", flags="f", type="group", name=cls.group, quiet=True) + @xfail_windows def test_v1(self): """Test v1 signature""" self.assertModule( @@ -195,6 +195,7 @@ def test_v1(self): self.assertEqual(res.get_cat(0)[1], 1) res.close() + @xfail_windows def test_v2(self): """Test v2 signature""" self.assertModule( From 877c7c492565bc5e251eeffd651c263aabdc35fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:08:22 +0000 Subject: [PATCH 36/42] tests: Exclude more tests that are failing on Windows --- .github/workflows/osgeo4w_gunittest.cfg | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/osgeo4w_gunittest.cfg b/.github/workflows/osgeo4w_gunittest.cfg index 22a5febe630..b9252cf49ef 100644 --- a/.github/workflows/osgeo4w_gunittest.cfg +++ b/.github/workflows/osgeo4w_gunittest.cfg @@ -5,18 +5,22 @@ # but it includes mainly tests which can (and should) be fixed. exclude = gui/wxpython/core/testsuite/toolboxes.sh - # lib/init/testsuite/test_grass_tmp_mapset.py + lib/init/testsuite/test_grass_tmp_mapset.py python/grass/gunittest/testsuite/test_gunitest_doctests.py python/grass/pygrass/raster/testsuite/test_pygrass_raster_doctests.py python/grass/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py - # python/grass/script/testsuite/test_script_doctests.py + python/grass/script/testsuite/test_script_doctests.py python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py temporal/t.info/testsuite/test.t.info.sh + temporal/t.rast.accdetect/testsuite/test.t.rast.accdetect.reverse.sh + temporal/t.rast.accdetect/testsuite/test.t.rast.accdetect.sh temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py + vector/v.edit/testsuite/select_all_flag.sh vector/v.in.lidar/testsuite/decimation_test.py vector/v.in.lidar/testsuite/mask_test.py vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py + vector/v.what.rast3/testsuite/test.v.what.rast3.sh vector/v.what/testsuite/test_vwhat_layers.py vector/v.what/testsuite/test_vwhat_ncspm.py From 63e7d669b7b0750dec0484aeaf8bc2c032eba14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:09:02 +0000 Subject: [PATCH 37/42] v.univar: Apply xfail_windows decorator to failing tests --- vector/v.univar/testsuite/test_v_univar.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vector/v.univar/testsuite/test_v_univar.py b/vector/v.univar/testsuite/test_v_univar.py index 766871d951c..e5fc2685cac 100644 --- a/vector/v.univar/testsuite/test_v_univar.py +++ b/vector/v.univar/testsuite/test_v_univar.py @@ -15,9 +15,11 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule +from grass.gunittest.utils import xfail_windows class TestProfiling(TestCase): + @xfail_windows def test_flagg(self): """Testing flag g with map lakes""" output_str = """n=15279 @@ -40,6 +42,7 @@ def test_flagg(self): v_univar.run() self.assertLooksLike(actual=v_univar.outputs.stdout, reference=output_str) + @xfail_windows def test_flage(self): """Testing flag e with map geology""" output_str = """number of features with non NULL attribute: 1832 @@ -68,6 +71,7 @@ def test_flage(self): v_univar.run() self.assertLooksLike(actual=v_univar.outputs.stdout, reference=output_str) + @xfail_windows def test_flagw(self): """Testing flag w with map lakes""" output_str = """number of features with non NULL attribute: 15279 @@ -83,6 +87,7 @@ def test_flagw(self): v_univar.run() self.assertLooksLike(actual=v_univar.outputs.stdout, reference=output_str) + @xfail_windows def test_flagd(self): """Testing flag d with map hospitals""" univar_string = """number of primitives: 160 From 3c65184c0a1a3f83a05d3302ca5bbc16f07b8a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:09:25 +0000 Subject: [PATCH 38/42] t.rast.univar: Apply xfail_windows decorator to a failing test --- temporal/t.rast.univar/testsuite/test_t_rast_univar.py | 1 + 1 file changed, 1 insertion(+) diff --git a/temporal/t.rast.univar/testsuite/test_t_rast_univar.py b/temporal/t.rast.univar/testsuite/test_t_rast_univar.py index 1f992a9d39e..dca870d6a98 100644 --- a/temporal/t.rast.univar/testsuite/test_t_rast_univar.py +++ b/temporal/t.rast.univar/testsuite/test_t_rast_univar.py @@ -179,6 +179,7 @@ def test_with_all_maps(self): res_line = res.split("|", 1)[1] self.assertLooksLike(ref_line, res_line) + @xfail_windows def test_with_subset_of_maps(self): t_rast_univar = SimpleModule( "t.rast.univar", From 4a0a546b026115b7aaa7105cfc88f966d9996d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:10:23 +0000 Subject: [PATCH 39/42] r.in.gdal: Try avoiding error in calling gdal-config in skipif decorator on Windows --- raster/r.in.gdal/testsuite/test_r_in_gdal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/raster/r.in.gdal/testsuite/test_r_in_gdal.py b/raster/r.in.gdal/testsuite/test_r_in_gdal.py index 355e9b74eda..2390e9838cd 100644 --- a/raster/r.in.gdal/testsuite/test_r_in_gdal.py +++ b/raster/r.in.gdal/testsuite/test_r_in_gdal.py @@ -4,6 +4,7 @@ """ import unittest +import sys from subprocess import check_output @@ -311,7 +312,8 @@ def test_netCDF_3d_5(self): self.assertLooksLike(map_list, text_from_file) @unittest.skipIf( - tuple( + not sys.platform.startswith("win") + and tuple( map( int, check_output(["gdal-config", "--version"]) From 6d1dad415d8601c32c1019f4b0b5ad8d0dedbe53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 20:50:02 +0000 Subject: [PATCH 40/42] CI(OSGeo4W): Increase min-success to 96% for gunittest --- .github/workflows/test_thorough.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index b26a085e95b..843adb4c4f0 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -2,4 +2,4 @@ set grass=%1 set python=%2 call %grass% --tmp-project XY --exec g.download.project url=https://grass.osgeo.org/sampledata/north_carolina/nc_spm_full_v2alpha2.tar.gz path=%USERPROFILE% -call %grass% --tmp-project XY --exec %python% -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 86 --config .github\workflows\osgeo4w_gunittest.cfg +call %grass% --tmp-project XY --exec %python% -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 96 --config .github\workflows\osgeo4w_gunittest.cfg From 352248230234baf3b9d5c4aea03a987955e95c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 20:15:27 -0400 Subject: [PATCH 41/42] Add line in test_grass_tmp_mapset.py --- lib/init/testsuite/test_grass_tmp_mapset.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/init/testsuite/test_grass_tmp_mapset.py b/lib/init/testsuite/test_grass_tmp_mapset.py index bf142a4117d..9379957cd3f 100644 --- a/lib/init/testsuite/test_grass_tmp_mapset.py +++ b/lib/init/testsuite/test_grass_tmp_mapset.py @@ -20,6 +20,7 @@ import subprocess from grass.gunittest.utils import xfail_windows + # Note that unlike rest of GRASS GIS, here we are using unittest package # directly. The grass.gunittest machinery for mapsets is not needed here. # How this plays out together with the rest of testing framework is yet to be From 7c6c75c4944b552c4fa302caf67ec827d5ba09ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 21 Sep 2024 20:17:17 -0400 Subject: [PATCH 42/42] Update test_r_tileset.py --- scripts/r.tileset/testsuite/test_r_tileset.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/r.tileset/testsuite/test_r_tileset.py b/scripts/r.tileset/testsuite/test_r_tileset.py index 15545512aea..cba9908d900 100644 --- a/scripts/r.tileset/testsuite/test_r_tileset.py +++ b/scripts/r.tileset/testsuite/test_r_tileset.py @@ -13,7 +13,6 @@ import os - output = """\ -78.77462049|35.6875073|-78.60830318|35.74855834|1506|678 -78.77462049|35.74855834|-78.60830318|35.80960938|1506|678