From 0351ac90e7f12918960401eac2e05ce62507bced Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Thu, 27 Aug 2020 15:37:03 -0700 Subject: [PATCH 1/2] Always set junit_family=xunit2 for pytest results This is to satisfy the Jenkins xunit plugin. Connects to https://github.com/ros2/ros2/issues/1016. Signed-off-by: Jacob Perron --- ros_buildfarm/workspace.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ros_buildfarm/workspace.py b/ros_buildfarm/workspace.py index 419ac912e..36d80c3ed 100644 --- a/ros_buildfarm/workspace.py +++ b/ros_buildfarm/workspace.py @@ -86,7 +86,9 @@ def call_build_tool( if colcon_verb == 'test': cmd += [ '--event-handlers', 'console_direct+', - '--executor', 'sequential'] + '--executor', 'sequential', + # Force junit_family to make Jenkins xunit plugin 2.x happy + '--pytest-args', '-o', 'junit_family=xunit2'] if force_cmake: if build_tool == 'catkin_make_isolated': From 9a69528b447b46e609dd0b91bd7d4d2cc3eb51d7 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Thu, 27 Aug 2020 16:15:27 -0700 Subject: [PATCH 2/2] Only set junit_family for Foxy and earlier Signed-off-by: Jacob Perron --- ros_buildfarm/workspace.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ros_buildfarm/workspace.py b/ros_buildfarm/workspace.py index 36d80c3ed..31ae2f8f1 100644 --- a/ros_buildfarm/workspace.py +++ b/ros_buildfarm/workspace.py @@ -86,9 +86,13 @@ def call_build_tool( if colcon_verb == 'test': cmd += [ '--event-handlers', 'console_direct+', - '--executor', 'sequential', - # Force junit_family to make Jenkins xunit plugin 2.x happy - '--pytest-args', '-o', 'junit_family=xunit2'] + '--executor', 'sequential'] + + # In Foxy and prior, xunit2 format is needed to make Jenkins xunit plugin 2.x happy + # After Foxy, we introduced per-package changes to make local builds and CI + # builds act the same. + if rosdistro_name in ('dashing', 'eloquent', 'foxy'): + cmd += ['--pytest-args', '-o', 'junit_family=xunit2'] if force_cmake: if build_tool == 'catkin_make_isolated':