diff --git a/Jenkinsfile b/Jenkinsfile index 6872ed250bb..c1b38c75042 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,10 +30,13 @@ export TEST_DIR=${env.TEST_DIR} export SOURCE_DIR=${env.SOURCE_DIR} export GIT_BRANCH=${env.GIT_BRANCH} export GIT_COMMIT=${env.GIT_COMMIT} -export PYTHONPATH=${env.TEST_DIR}/../ export PYTHONWARNINGS=error export LOGLEVEL=debug -ln -sf /data/openpilot/opendbc_repo/opendbc /data/opendbc + +unset PYTHONPATH +if [ -f "${env.TEST_DIR}/.venv/bin/activate" ]; then + source "${env.TEST_DIR}/.venv/bin/activate" +fi # TODO: this is an agnos issue export PYTEST_ADDOPTS="-p no:asyncio" diff --git a/tests/setup_device_ci.sh b/tests/setup_device_ci.sh index fe28b8612cb..2ad42e1122e 100755 --- a/tests/setup_device_ci.sh +++ b/tests/setup_device_ci.sh @@ -45,8 +45,6 @@ sleep infinity EOF chmod +x $CONTINUE_PATH - -# set up environment if [ ! -d "$SOURCE_DIR" ]; then git clone https://github.com/commaai/panda.git $SOURCE_DIR fi @@ -71,6 +69,12 @@ git clean -xdff echo "git checkout done, t=$SECONDS" du -hs $SOURCE_DIR $SOURCE_DIR/.git -rsync -a --delete $SOURCE_DIR $TEST_DIR +rsync -a --delete "$SOURCE_DIR" "$TEST_DIR" + +# /usr/comma/shims/uv wraps uv in sudo, which roots the venv — use the real binary +UV=$(type -ap uv | grep -vF /usr/comma/shims | head -n1) +# use panda's environment so dependencies come from its pyproject.toml +PYTHONWARNINGS=default "$UV" sync --project "$TEST_DIR" --cache-dir="/data/uv_cache" --all-extras --upgrade-package opendbc +"$UV" cache prune --cache-dir=/data/uv_cache echo "$TEST_DIR synced with $GIT_COMMIT, t=$SECONDS"