bayesmix-dev / bayesmix

Flexible Bayesian nonparametric mixture models in C++
https://bayesmix.rtfd.io
BSD 3-Clause "New" or "Revised" License
22 stars 18 forks source link

Fix Python tests #141

Closed mberaha closed 1 year ago

mberaha commented 2 years ago

For some reasons, CI tests fail with Python but work locally

==================================== ERRORS ====================================
[35](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:36)
_____________________ ERROR collecting tests/test_build.py _____________________
[36](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:37)
ImportError while importing test module '/usr/bayesmix/python/tests/test_build.py'.
[37](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:38)
Hint: make sure your test modules/packages have valid Python names.
[38](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:39)
Traceback:
[39](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:40)
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
[40](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:41)
    return _bootstrap._gcd_import(name[level:], package, level)
[41](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:42)
tests/test_build.py:1: in <module>
[42](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:43)
    from bayesmixpy import build_bayesmix
[43](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:44)
E   ModuleNotFoundError: No module named 'bayesmixpy'
[44](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:45)
______________________ ERROR collecting tests/test_run.py ______________________
[45](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:46)
ImportError while importing test module '/usr/bayesmix/python/tests/test_run.py'.
[46](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:47)
Hint: make sure your test modules/packages have valid Python names.
[47](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:48)
Traceback:
[48](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:49)
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
[49](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:50)
    return _bootstrap._gcd_import(name[level:], package, level)
[50](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:51)
tests/test_run.py:2: in <module>
[51](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:52)
    from bayesmixpy import run_mcmc
[52](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:53)
E   ModuleNotFoundError: No module named 'bayesmixpy'
[53](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:54)
=========================== short test summary info ============================
[54](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:55)
ERROR tests/test_build.py
[55](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:56)
ERROR tests/test_run.py
[56](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:57)
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
[57](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:58)
============================== 2 errors in 0.15s ===============================
[58](https://github.com/bayesmix-dev/bayesmix/runs/7175345771?check_suite_focus=true#step:6:59)
Error: Process completed with exit code 2.
TeoGiane commented 1 year ago

Don't know what happened in the meantime, but I've revised a little bit our GitHub actions. I tried, once all changes have been applied, to run python tests (simply uncommenting lines in test.yaml).

Now, they seems to work in CI (see this logs).

So I guess we can close it!

brunoguindani commented 1 year ago

@mberaha please close this if we're good