Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Add xfail_windows decorator for failing tests on windows #233

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
34ad40d
grass.gunittest: Add xfail_windows decorator for Windows expected fai…
echoix Sep 18, 2024
8f9b9dd
lib/imagery: Add xfail_windows decorator to test functions
echoix Sep 18, 2024
0131b6e
Fix spacing issue in xfail_windows warning message
echoix Sep 19, 2024
f9f6553
Add stacklevel=2 to xfail_windows decorator warning message
echoix Sep 19, 2024
1064dff
Update utils.py
echoix Sep 19, 2024
a371541
Format end of file
echoix Sep 19, 2024
c2f9bdd
Comment out warning in decorator
echoix Sep 19, 2024
d48600c
Merge branch main into windows-xfail-gunittest
echoix Sep 19, 2024
e3d2b74
i.maxlik: Add xfail_windows decorator to SuccessTest class
echoix Sep 19, 2024
c039635
lib/gis: Add xfail_windows decorator to TestNewlinesWithGetlFunctions…
echoix Sep 19, 2024
87c317d
Update warning stacklevel to 3
echoix Sep 19, 2024
69cac23
Update utils.py
echoix Sep 19, 2024
ffac6b6
Update utils.py
echoix Sep 19, 2024
2abdcd0
Update utils.py
echoix Sep 19, 2024
30cd437
Merge branch 'main' into windows-xfail-gunittest
echoix Sep 19, 2024
f892eb7
tests: Add expected failures to failing tests on windows
echoix Sep 19, 2024
b2f71f6
tests: Apply xfail_windows decorator to setUpClass in lib/gis getl tests
echoix Sep 19, 2024
7c0773d
tests: Apply xfail_windows decorator to parser json tests in lib/gis
echoix Sep 19, 2024
9d370b7
tests: Apply xfail_windows decorator to failing test in lib/imagery
echoix Sep 19, 2024
9e764d0
Remove wrong import of xfail_windows
echoix Sep 19, 2024
20eb947
tests: Temporarily remove all gunittest exclusions
echoix Sep 19, 2024
e220246
Merge branch 'main' into windows-xfail-gunittest
echoix Sep 21, 2024
d55ba68
tests: Apply xfail_windows decorator to failing test in test_gcmd.py
echoix Sep 21, 2024
960befe
tests: Apply xfail_windows decorator to failing test in lib/init in t…
echoix Sep 21, 2024
e33dfce
CI(OSGeo4W): Use an OSGeo4W-specific gunittest.cfg config file
echoix Sep 21, 2024
c9599fc
Revert "tests: Temporarily remove all gunittest exclusions"
echoix Sep 21, 2024
2221cbc
v.out.lidar: Apply xfail_windows decorator to one failing test
echoix Sep 21, 2024
a499573
t.rast.series: Apply xfail_windows decorator to failing tests
echoix Sep 21, 2024
2dc4d80
t.connect: Apply xfail_windows decorator to three failing tests
echoix Sep 21, 2024
9fff0ef
g.search.modules: Apply xfail_windows decorator to a failing test
echoix Sep 21, 2024
1c5a426
grass.temporal: Apply xfail_windows decorator to failing tests in uni…
echoix Sep 21, 2024
3a30a57
grass.gunittest: Apply xfail_windows decorator to failing test test_a…
echoix Sep 21, 2024
aa3ff5e
tests: Re-enable excluded tests that are not failing on Windows
echoix Sep 21, 2024
2d488ee
tests: Re-enable passing tests from .gunittest.cfg exclusion list
echoix Sep 21, 2024
e14e3b2
Update test_gis_lib_getl.py
echoix Sep 21, 2024
362e9fe
Update test_raster_img.py
echoix Sep 21, 2024
10a7d67
tests: Try re-enabling python/grass/script/testsuite/test_script_doct…
echoix Sep 21, 2024
4108192
i.maxlik: Add xfail_windows decorator to all tests in class
echoix Sep 21, 2024
877c7c4
tests: Exclude more tests that are failing on Windows
echoix Sep 21, 2024
63e7d66
v.univar: Apply xfail_windows decorator to failing tests
echoix Sep 21, 2024
3c65184
t.rast.univar: Apply xfail_windows decorator to a failing test
echoix Sep 21, 2024
4a0a546
r.in.gdal: Try avoiding error in calling gdal-config in skipif decora…
echoix Sep 21, 2024
6d1dad4
CI(OSGeo4W): Increase min-success to 96% for gunittest
echoix Sep 21, 2024
a15815a
Merge branch 'main' into windows-xfail-gunittest
echoix Sep 21, 2024
3522482
Add line in test_grass_tmp_mapset.py
echoix Sep 22, 2024
7c6c75c
Update test_r_tileset.py
echoix Sep 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/imagery/testsuite/test_imagery_signature_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
15 changes: 15 additions & 0 deletions python/grass/gunittest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
from pathlib import Path
import shutil
import sys
from unittest import expectedFailure
import warnings



echoix marked this conversation as resolved.
Show resolved Hide resolved
def ensure_dir(directory):
Expand Down Expand Up @@ -80,3 +83,15 @@ 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", stacklevel=2)
return expectedFailure(test_item)
Loading