-
We sometime meet pytest fail in OpenVINO CI, but we don't know how to reproduce and fix it locally. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There is a doc for that: https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/python/BUILDING.md What I didmake sure cmake has correct settings:$ cd build
$ cmake -LA -N .. | grep ENABLE_PYTHON
$ cmake -LA -N .. | grep ENABLE_OV_ONNX_FRONTEND
$ cmake -LA -N .. | grep CMAKE_INSTALL_PREFIX
# add ENABLE_PYTHON=ON ENABLE_OV_ONNX_FRONTEND=ON CMAKE_INSTALL_PREFIX=./install if needed create virtual env, install dependency, run pytest# pip3 install virtualenv
$ python3 -m virtualenv ov
$ source ./ov/bin/active
# install openvino pybinding in virtual env (after make install -j8)
(ov) $ source ./install/setupvars.sh
(ov) $ cd "${OPENVINO_BASEDIR}/src/bindings/python" # this must be current folder, pytest will try to find tests in cwd
(ov) $ pip3 install -r requirements.txt
(ov) $ pip3 install -r requirements_test.txt
(ov) $ pytest tests -v -k 'not _cuda' --ignore=tests/test_onnx/test_zoo_models.py --ignore=tests/test_inference_engine using legacy tox based testshttps://stackoverflow.com/questions/54873637/how-to-run-tests-with-tox-ini using pytest --backend="CPU" tests -v -k 'not _cuda' --ignore=tests/test_onnx/test_zoo_models.py --ignore=tests/test_inference_engine
pytest --backend="CPU" tests_compatibility -v -k 'not _cuda' --ignore=tests_compatibility/test_onnx/test_zoo_models.py
pytest --backend="CPU" tests/test_onnx/test_zoo_models.py -v -n 4 --forked -k 'not _cuda' --model_zoo_xfail |
Beta Was this translation helpful? Give feedback.
-
Debug pytestIf we only want to debug the C++ part invoked by a python script, than the simplest way is using gdb: gdb --args python3 `which pytest` tests -v -k 'not _cuda' --ignore=tests/test_onnx/test_zoo_models.py --ignore=tests/test_inference_engine or gdb python3
$ run /path/to/pytest tests -v -k 'not _cuda' --ignore=tests/test_onnx/test_zoo_models.py --ignore=tests/test_inference_engine |
Beta Was this translation helpful? Give feedback.
Debug pytest
If we only want to debug the C++ part invoked by a python script, than the simplest way is using gdb:
or
gdb python3 $ run /path/to/pytest tests -v -k 'not _cuda' --ignore=tests/test_onnx/test_zoo_models.py --ignore=tests/test_inference_engine