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

Windows test failures 2024-04 #622

Closed
jmartin-tech opened this issue Apr 23, 2024 · 2 comments · Fixed by #626
Closed

Windows test failures 2024-04 #622

jmartin-tech opened this issue Apr 23, 2024 · 2 comments · Fixed by #626
Assignees
Labels
bug Something isn't working windows Windows-specific issues

Comments

@jmartin-tech
Copy link
Collaborator

Test execution fails in Windows:

Testing Env:

  • Windows 10 Pro
  • miniconda3 - Python 3.12.2
  • ecoji install mitigation applied
  • Repository checkout install based on efbdb24
(base) PS C:\Users\Win10x64\Projects\garak> python -m pytest .\tests\
================================================= test session starts =================================================
platform win32 -- Python 3.12.2, pytest-8.1.1, pluggy-1.5.0
rootdir: C:\Users\Win10x64\Projects\garak
configfile: pyproject.toml
plugins: anyio-4.3.0
collected 260 items / 3 errors

======================================================= ERRORS ========================================================
_________________________________ ERROR collecting tests/plugins/test_plugin_load.py __________________________________
tests\plugins\test_plugin_load.py:16: in <module>
    classname for (classname, active) in _plugins.enumerate_plugins("detectors")
garak\_plugins.py:65: in enumerate_plugins
    mod = importlib.import_module(f"garak.{category}.{module_name}")
..\..\miniconda3\Lib\importlib\__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:995: in exec_module
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
garak\detectors\riskywords.py:15: in <module>
    for row in reader:
..\..\miniconda3\Lib\csv.py:115: in __next__
    self.fieldnames
..\..\miniconda3\Lib\csv.py:102: in fieldnames
    self._fieldnames = next(self.reader)
..\..\miniconda3\Lib\encodings\cp1252.py:23: in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
E   UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 7469: character maps to <undefined>
_________________________________ ERROR collecting tests/probes/test_probe_format.py __________________________________
tests\probes\test_probe_format.py:9: in <module>
    for (classname, active) in _plugins.enumerate_plugins(
garak\_plugins.py:65: in enumerate_plugins
    mod = importlib.import_module(f"garak.{category}.{module_name}")
..\..\miniconda3\Lib\importlib\__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:995: in exec_module
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
garak\detectors\riskywords.py:15: in <module>
    for row in reader:
..\..\miniconda3\Lib\csv.py:115: in __next__
    self.fieldnames
..\..\miniconda3\Lib\csv.py:102: in fieldnames
    self._fieldnames = next(self.reader)
..\..\miniconda3\Lib\encodings\cp1252.py:23: in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
E   UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 7469: character maps to <undefined>
_________________________________________ ERROR collecting tests/test_docs.py _________________________________________
tests\test_docs.py:10: in <module>
    str(i).split("/")[2].replace(".py", "")
E   IndexError: list index out of range
=============================================== short test summary info ===============================================
ERROR tests/plugins/test_plugin_load.py - UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 7469: character maps to <undefined>
ERROR tests/probes/test_probe_format.py - UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 7469: character maps to <undefined>
ERROR tests/test_docs.py - IndexError: list index out of range
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================= 3 errors in 18.25s ==================================================
@jmartin-tech jmartin-tech added the bug Something isn't working label Apr 23, 2024
@leondz leondz added the windows Windows-specific issues label Apr 23, 2024
@leondz
Copy link
Collaborator

leondz commented Apr 23, 2024

Thanks for collating this. Looks like the same encoding issue as in ecoji, plus a path awry in test_docs.

@jmartin-tech jmartin-tech self-assigned this Apr 23, 2024
@jmartin-tech
Copy link
Collaborator Author

Yep, working thru revisions required, looks like some tests fail on windows, so I will see about resolving those where possible as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows Windows-specific issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants