From bf2bd689455ef1142b89e83236739aeebd90c37e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Crist=C3=B3bal=20Arroyo?= Date: Wed, 31 Jan 2024 14:49:03 -0500 Subject: [PATCH] Fix `pytest-rerunfailures` installation by using apt instead of pip (#1020) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Change installation of pytest-rerunfailures to use apt Signed-off-by: Cristóbal Arroyo * Initial commit * Remove os_code_name Signed-off-by: Cristóbal Arroyo --------- Signed-off-by: Cristóbal Arroyo --- ros_buildfarm/templates/devel/devel_task.Dockerfile.em | 6 +++++- .../snippet/install_pytest-rerunfailures.Dockerfile.em | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 ros_buildfarm/templates/snippet/install_pytest-rerunfailures.Dockerfile.em diff --git a/ros_buildfarm/templates/devel/devel_task.Dockerfile.em b/ros_buildfarm/templates/devel/devel_task.Dockerfile.em index 682df198c..95d1a79b3 100644 --- a/ros_buildfarm/templates/devel/devel_task.Dockerfile.em +++ b/ros_buildfarm/templates/devel/devel_task.Dockerfile.em @@ -66,7 +66,11 @@ RUN python3 -u /tmp/wrapper_scripts/apt.py update-install-clean -q -y git python RUN python3 -u /tmp/wrapper_scripts/apt.py update-install-clean -q -y python3-pip @# colcon-core.package_identification.python needs at least setuptools 30.3.0 @# pytest-rerunfailures enables usage of --retest-until-pass -RUN pip3 install -U setuptools==59.6.0 pytest-rerunfailures +@(TEMPLATE( + 'snippet/install_pytest-rerunfailures.Dockerfile.em', + os_name=os_name, +))@ +RUN pip3 install -U setuptools==59.6.0 @[end if]@ RUN python3 -u /tmp/wrapper_scripts/apt.py update-install-clean -q -y ccache diff --git a/ros_buildfarm/templates/snippet/install_pytest-rerunfailures.Dockerfile.em b/ros_buildfarm/templates/snippet/install_pytest-rerunfailures.Dockerfile.em new file mode 100644 index 000000000..727ebf0da --- /dev/null +++ b/ros_buildfarm/templates/snippet/install_pytest-rerunfailures.Dockerfile.em @@ -0,0 +1,4 @@ +@[if os_name == 'debian' or os_name == 'ubuntu']@ +@# python3-pytest-rerunfailures is supported since Ubuntu jammy +RUN for i in 1 2 3; do apt-get update && apt-get install -q -y python3-pytest-rerunfailures && apt-get clean && break || if [ $i -lt 3 ]; then sleep 5; else false; fi; done +@[end if]@