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

CI is failing with pytest-related import errors during the collection stage #4570

Closed
joshuacwnewton opened this issue Jul 22, 2024 · 1 comment · Fixed by #4571
Closed

CI is failing with pytest-related import errors during the collection stage #4570

joshuacwnewton opened this issue Jul 22, 2024 · 1 comment · Fixed by #4571
Labels
CI category: TravisCI, GitHub Actions, etc. upstream Issue caused by software dependencies
Milestone

Comments

@joshuacwnewton
Copy link
Member

We started getting errors for two separate sets of OSs:

Tests / Windows (Native)

=========================== short test summary info ===========================
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\matplotlib\tests - OSError: The baseline image directory does not exist. This is most likely because the test data is not installed. You may need to install matplotlib from source to get the test data.
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\mpl_toolkits\axes_grid1\tests - OSError: The baseline image directory does not exist. This is most likely because the test data is not installed. You may need to install matplotlib from source to get the test data.
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\mpl_toolkits\axisartist\tests - OSError: The baseline image directory does not exist. This is most likely because the test data is not installed. You may need to install matplotlib from source to get the test data.
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\mpl_toolkits\mplot3d\tests - OSError: The baseline image directory does not exist. This is most likely because the test data is not installed. You may need to install matplotlib from source to get the test data.
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\numpy - ModuleNotFoundError: No module named 'hypothesis'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\pandas - ModuleNotFoundError: No module named 'hypothesis'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\scipy - ModuleNotFoundError: No module named 'hypothesis'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sqlalchemy\testing\suite\test_cte.py - AttributeError: 'NoneType' object has no attribute 'fixture'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sqlalchemy\testing\suite\test_ddl.py - AttributeError: 'NoneType' object has no attribute 'fixture'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sqlalchemy\testing\suite\test_dialect.py - AttributeError: 'NoneType' object has no attribute 'fixture'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sqlalchemy\testing\suite\test_insert.py - AttributeError: 'NoneType' object has no attribute 'fixture'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sqlalchemy\testing\suite\test_reflection.py - AttributeError: 'NoneType' object has no attribute 'fixture'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sqlalchemy\testing\suite\test_results.py - AttributeError: 'NoneType' object has no attribute 'fixture'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sqlalchemy\testing\suite\test_select.py - AttributeError: 'NoneType' object has no attribute 'fixture'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sqlalchemy\testing\suite\test_sequence.py - AttributeError: 'NoneType' object has no attribute 'fixture'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sqlalchemy\testing\suite\test_types.py - AttributeError: 'NoneType' object has no attribute 'fixture'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sqlalchemy\testing\suite\test_update_delete.py - AttributeError: 'NoneType' object has no attribute 'fixture'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\envs\venv_sct\Lib\site-packages\sympy - ImportError: hypothesis is a required dependency to run the SymPy test suite. Install it with 'pip install hypothesis' or 'conda install -c conda-forge hypothesis'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\pkgs\anaconda-anon-usage-0.4.4-py312hfc23b7f_100\info\test\tests - ModuleNotFoundError: No module named 'conda'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\pkgs\boltons-23.0.0-py312haa95532_0\info\test\tests - _pytest.pathlib.ImportPathMismatchError: ('tests.conftest', 'C:\\Users\\runneradmin\\sct_6.4.dev0\\python\\envs\\venv_sct\\Lib\\site-packages\\wandb\\vendor\\promise-2.3.0\\tests\\conftest.py', WindowsPath('C:/Users/runneradmin/sct_6.4.dev0/python/pkgs/boltons-23.0.0-py312haa95532_0/info/test/tests/conftest.py'))
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\pkgs\conda-package-handling-2.3.0-py312haa95532_0\info\test\tests - _pytest.pathlib.ImportPathMismatchError: ('tests.conftest', 'C:\\Users\\runneradmin\\sct_6.4.dev0\\python\\envs\\venv_sct\\Lib\\site-packages\\wandb\\vendor\\promise-2.3.0\\tests\\conftest.py', WindowsPath('C:/Users/runneradmin/sct_6.4.dev0/python/pkgs/conda-package-handling-2.3.0-py312haa95532_0/info/test/tests/conftest.py'))
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\pkgs\cryptography-42.0.5-py312h89fc84f_1\info\test\tests - _pytest.pathlib.ImportPathMismatchError: ('tests.conftest', 'C:\\Users\\runneradmin\\sct_6.4.dev0\\python\\envs\\venv_sct\\Lib\\site-packages\\wandb\\vendor\\promise-2.3.0\\tests\\conftest.py', WindowsPath('C:/Users/runneradmin/sct_6.4.dev0/python/pkgs/cryptography-42.0.5-py312h89fc84f_1/info/test/tests/conftest.py'))
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\pkgs\menuinst-2.1.1-py312h5da7b33_0\info\test\tests - ModuleNotFoundError: No module named 'menuinst'
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\pkgs\tqdm-4.66.4-py312hfc267ef_0\info\test\tests - _pytest.pathlib.ImportPathMismatchError: ('tests.conftest', 'C:\\Users\\runneradmin\\sct_6.4.dev0\\python\\envs\\venv_sct\\Lib\\site-packages\\wandb\\vendor\\promise-2.3.0\\tests\\conftest.py', WindowsPath('C:/Users/runneradmin/sct_6.4.dev0/python/pkgs/tqdm-4.66.4-py312hfc267ef_0/info/test/tests/conftest.py'))
ERROR C:\Users\runneradmin\sct_6.4.dev0\python\pkgs\truststore-0.8.0-py312haa95532_0\info\test\tests - _pytest.pathlib.ImportPathMismatchError: ('tests.conftest', 'C:\\Users\\runneradmin\\sct_6.4.dev0\\python\\envs\\venv_sct\\Lib\\site-packages\\wandb\\vendor\\promise-2.3.0\\tests\\conftest.py', WindowsPath('C:/Users/runneradmin/sct_6.4.dev0/python/pkgs/truststore-0.8.0-py312haa95532_0/info/test/tests/conftest.py'))
!!!!!!!!!!!!!!!!!! Interrupted: 25 errors during collection !!!!!!!!!!!!!!!!!!!

Create release / Ubuntu

=========================== short test summary info ============================
ERROR ../../../sct_0.0/python/pkgs/anaconda-anon-usage-0.4.4-py312hfc0e8ea_100/info/test/tests - ModuleNotFoundError: No module named 'conda'
ERROR ../../../sct_0.0/python/pkgs/conda-package-handling-2.3.0-py312h06a4308_0/info/test/tests - _pytest.pathlib.ImportPathMismatchError: ('tests.conftest', '/home/runner/sct_0.0/python/pkgs/boltons-23.0.0-py312h06a4308_0/info/test/tests/conftest.py', PosixPath('/home/runner/sct_0.0/python/pkgs/conda-package-handling-2.3.0-py312h06a4308_0/info/test/tests/conftest.py'))
ERROR ../../../sct_0.0/python/pkgs/cryptography-42.0.5-py312hdda0065_1/info/test/tests - _pytest.pathlib.ImportPathMismatchError: ('tests.conftest', '/home/runner/sct_0.0/python/pkgs/boltons-23.0.0-py312h06a4308_0/info/test/tests/conftest.py', PosixPath('/home/runner/sct_0.0/python/pkgs/cryptography-42.0.5-py312hdda0065_1/info/test/tests/conftest.py'))
ERROR ../../../sct_0.0/python/pkgs/menuinst-2.1.1-py312h06a4308_0/info/test/tests - ModuleNotFoundError: No module named 'menuinst'
ERROR ../../../sct_0.0/python/pkgs/tqdm-4.66.4-py312he106c6f_0/info/test/tests - _pytest.pathlib.ImportPathMismatchError: ('tests.conftest', '/home/runner/sct_0.0/python/pkgs/boltons-23.0.0-py312h06a4308_0/info/test/tests/conftest.py', PosixPath('/home/runner/sct_0.0/python/pkgs/tqdm-4.66.4-py312he106c6f_0/info/test/tests/conftest.py'))
ERROR ../../../sct_0.0/python/pkgs/truststore-0.8.0-py312h06a4308_0/info/test/tests - _pytest.pathlib.ImportPathMismatchError: ('tests.conftest', '/home/runner/sct_0.0/python/pkgs/boltons-23.0.0-py312h06a4308_0/info/test/tests/conftest.py', PosixPath('/home/runner/sct_0.0/python/pkgs/truststore-0.8.0-py312h06a4308_0/info/test/tests/conftest.py'))
!!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!!

I'll try to get to the bottom of which package upgrade is causing these issues, and report upstream if necessary.

@joshuacwnewton joshuacwnewton added upstream Issue caused by software dependencies CI category: TravisCI, GitHub Actions, etc. labels Jul 22, 2024
@joshuacwnewton
Copy link
Member Author

Aha! I think I know the issue here.

python_files = testing/**/test_*.py

And, of course, this fails miserably because we are not set up to run our dependencies' tests whatsoever.

So, I will have to figure out how pytest has changed its config to parse tests differently. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI category: TravisCI, GitHub Actions, etc. upstream Issue caused by software dependencies
Projects
None yet
1 participant