add pytest.ini for kernel explorer

This commit is contained in:
Tianlei Wu 2025-01-31 23:22:11 +00:00
parent b36b91b4c8
commit 93d73bf831
3 changed files with 15 additions and 6 deletions

View file

@ -26,8 +26,8 @@ if build_dir is None:
if not os.path.exists(build_dir):
raise ValueError(f"KERNEL_EXPLORER_BUILD_DIR ({build_dir}) points to nonexistent path")
# onnxruntime_pybind11_state and kernel_explorer
sys.path.insert(0, build_dir)
# add path for onnxruntime_pybind11_state
sys.path.insert(0, os.path.join(build_dir, "onnxruntime", "capi"))
# pylint: disable=wrong-import-position
import onnxruntime_pybind11_state # noqa: E402

View file

@ -0,0 +1,11 @@
[pytest]
# Add default command-line options
addopts = --maxfail=3 -v
# Add the current directory to the beginning of sys.path for the duration of the test session.
pythonpath = .
# Enables logging to the console during test runs
log_cli = true
log_level = INFO

View file

@ -177,7 +177,6 @@ jobs:
--user $UID:$(id -g $USER) \
--volume $(Build.SourcesDirectory):/onnxruntime_src \
--volume $(Build.BinariesDirectory):/build \
--workdir /build/Release \
-e OPENBLAS_NUM_THREADS=1 \
-e OPENMP_NUM_THREADS=1 \
-e MKL_NUM_THREADS=1 \
@ -189,9 +188,8 @@ jobs:
/bin/bash -c "
set -ex; \
env; \
cd /build/Release; \
python --version; \
pytest /onnxruntime_src/onnxruntime/python/tools/kernel_explorer/ -n 4 --reruns 1 --durations=100"
cd /onnxruntime_src/onnxruntime/python/tools/kernel_explorer/kernels; \
pytest -n 4 --reruns 1 --durations=100"
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Run kernel explorer tests'
condition: succeededOrFailed()