Skip to content

Commit ef65537

Browse files
committed
test(colcon): configure our pkgs to use pytest
to ensure that the CI `colcon test` run works, because with a change to python 3.12 the `unittest` standard library used by default with colcon now exits with an error code of 5 for an empty test suite. See: colcon/colcon-core#678 See: python/cpython#102051
1 parent 1cd061d commit ef65537

File tree

24 files changed

+45
-16
lines changed

24 files changed

+45
-16
lines changed

bitbots_behavior/bitbots_body_behavior/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<depend>tf_transformations</depend>
3131
<depend>tf2</depend>
3232

33+
<test_depend>python3-pytest</test_depend>
3334

3435
<export>
3536
<rosdoc config="rosdoc.yaml"/>

bitbots_behavior/bitbots_body_behavior/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import glob
22

3-
from setuptools import setup
3+
from setuptools import find_packages, setup
44

55
package_name = "bitbots_body_behavior"
66

77

88
setup(
99
name=package_name,
10-
packages=[package_name],
10+
packages=find_packages(exclude=["test"]),
1111
data_files=[
1212
("share/" + package_name, ["package.xml"]),
1313
("share/ament_index/resource_index/packages", ["resource/" + package_name]),

bitbots_misc/bitbots_technical_challenge_vision/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
("share/" + package_name + "/launch", glob.glob("launch/*.launch")),
1717
],
1818
install_requires=["setuptools"],
19+
tests_require=["pytest"],
1920
zip_safe=True,
2021
maintainer="par",
2122
maintainer_email="[email protected]",

bitbots_misc/bitbots_teleop/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<depend>std_msgs</depend>
2121
<depend>tf_transformations</depend>
2222

23+
<test_depend>python3-pytest</test_depend>
24+
2325
<export>
2426
<bitbots_documentation>
2527
<language>python2</language>

bitbots_misc/bitbots_teleop/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"launch",
2020
"setuptools",
2121
],
22+
tests_require=["pytest"],
2223
zip_safe=True,
2324
keywords=["ROS"],
2425
license="MIT",

bitbots_misc/bitbots_tts/package.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<maintainer email="[email protected]">Hamburg Bit-Bots</maintainer>
1212

1313
<license>MIT</license>
14-
14+
1515
<author email="[email protected]">Marc Bestmann</author>
1616

1717
<buildtool_depend>ament_cmake</buildtool_depend>
@@ -21,6 +21,8 @@
2121
<depend>espeak</depend>
2222
<depend>std_msgs</depend>
2323

24+
<test_depend>python3-pytest</test_depend>
25+
2426
<export>
2527
<bitbots_documentation>
2628
<status>broken</status>

bitbots_misc/bitbots_tts/setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name=package_name,
9-
packages=find_packages(),
9+
packages=find_packages(exclude=["test"]),
1010
data_files=[
1111
("share/" + package_name, ["package.xml"]),
1212
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
@@ -16,6 +16,7 @@
1616
install_requires=[
1717
"setuptools",
1818
],
19+
tests_require=["pytest"],
1920
scripts=glob.glob("scripts/*"),
2021
entry_points={
2122
"console_scripts": [

bitbots_misc/system_monitor/package.xml

+6-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<maintainer email="[email protected]">Hamburg Bit-Bots</maintainer>
1212

1313
<license>MIT</license>
14-
14+
1515
<author email="[email protected]">Finn-Thorben Sell</author>
1616

1717
<buildtool_depend>ament_cmake</buildtool_depend>
@@ -21,7 +21,10 @@
2121
<depend>rclpy</depend>
2222
<depend>bitbots_msgs</depend>
2323

24-
<export><build_type>ament_python</build_type>
24+
<test_depend>python3-pytest</test_depend>
25+
26+
<export>
27+
<build_type>ament_python</build_type>
2528
</export>
2629

27-
</package>
30+
</package>

bitbots_misc/system_monitor/setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name=package_name,
9-
packages=find_packages(),
9+
packages=find_packages(exclude=["test"]),
1010
data_files=[
1111
("share/" + package_name, ["package.xml"]),
1212
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
@@ -18,6 +18,7 @@
1818
install_requires=[
1919
"setuptools",
2020
],
21+
tests_require=["pytest"],
2122
entry_points={
2223
"console_scripts": [
2324
"monitor = system_monitor.monitor:main",

bitbots_motion/bitbots_animation_rqt/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<exec_depend>rqt_gui</exec_depend>
2323
<exec_depend>std_srvs</exec_depend>
2424

25+
<test_depend>python3-pytest</test_depend>
26+
2527
<export>
2628
<architecture_independent/>
2729
<rqt_gui plugin="${prefix}/plugin.xml"/>

bitbots_motion/bitbots_animation_rqt/setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
setup(
66
name=package_name,
7-
packages=find_packages(),
7+
packages=find_packages(exclude=["test"]),
88
data_files=[
99
("share/" + package_name + "/resource", ["resource/RecordUI.ui"]),
1010
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
1111
("share/" + package_name, ["package.xml"]),
1212
("share/" + package_name, ["plugin.xml"]),
1313
],
1414
install_requires=["setuptools"],
15+
tests_require=["pytest"],
1516
zip_safe=True,
1617
entry_points={
1718
"console_scripts": [

bitbots_motion/bitbots_animation_server/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<depend>rclpy</depend>
2323
<depend>std_msgs</depend>
2424

25+
<test_depend>python3-pytest</test_depend>
26+
2527
<export>
2628
<bitbots_documentation>
2729
<status>tested_integration</status>

bitbots_motion/bitbots_animation_server/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"launch",
1919
"setuptools",
2020
],
21+
tests_require=["pytest"],
2122
zip_safe=True,
2223
keywords=["ROS"],
2324
license="MIT",

bitbots_simulation/bitbots_robocup_api/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<depend>topic_tools</depend>
3030
<depend>rosbag2</depend>
3131

32+
<test_depend>python3-pytest</test_depend>
33+
3234
<export>
3335
<build_type>ament_python</build_type>
3436
<bitbots_documentation>

bitbots_simulation/bitbots_robocup_api/setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name=package_name,
10-
packages=find_packages(),
10+
packages=find_packages(exclude=["test"]),
1111
data_files=[
1212
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
1313
(os.path.join("share", package_name), ["package.xml"]),
@@ -18,6 +18,7 @@
1818
"launch",
1919
"setuptools",
2020
],
21+
tests_require=["pytest"],
2122
zip_safe=True,
2223
keywords=["ROS"],
2324
license="MIT",

bitbots_team_communication/bitbots_team_communication/setup.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@
88
install_requires=[
99
"setuptools",
1010
],
11-
extras_require={
12-
"dev": ["pytest", "syrupy"],
13-
},
11+
tests_require=["pytest", "syrupy"],
1412
)

bitbots_team_communication/bitbots_team_data_sim_rqt/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<exec_depend>rqt_gui</exec_depend>
2323
<exec_depend>std_srvs</exec_depend>
2424

25+
<test_depend>python3-pytest</test_depend>
26+
2527
<export>
2628
<architecture_independent/>
2729
<rqt_gui plugin="${prefix}/plugin.xml"/>

bitbots_team_communication/bitbots_team_data_sim_rqt/setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
setup(
66
name=package_name,
7-
packages=find_packages(),
7+
packages=find_packages(exclude=["test"]),
88
data_files=[
99
("share/" + package_name + "/resource", ["resource/RobotTeamDataSimulator.ui"]),
1010
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
1111
("share/" + package_name, ["package.xml"]),
1212
("share/" + package_name, ["plugin.xml"]),
1313
],
1414
install_requires=["setuptools"],
15+
tests_require=["pytest"],
1516
zip_safe=True,
1617
entry_points={
1718
"console_scripts": [

bitbots_vision/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
<depend>std_msgs</depend>
4141
<depend>vision_opencv</depend>
4242

43+
<test_depend>python3-pytest</test_depend>
44+
4345
<export>
4446
<bitbots_documentation>
4547
<language>python3</language>

bitbots_vision/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"launch",
2424
"setuptools",
2525
],
26+
tests_require=["pytest"],
2627
zip_safe=True,
2728
keywords=["ROS"],
2829
license="MIT",

bitbots_world_model/bitbots_ball_filter/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<depend>std_srvs</depend>
2424
<depend>tf2_geometry_msgs</depend>
2525

26+
<test_depend>python3-pytest</test_depend>
27+
2628
<export>
2729
<bitbots_documentation>
2830
<language>python3</language>

bitbots_world_model/bitbots_ball_filter/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"launch",
2525
"setuptools",
2626
],
27+
tests_require=["pytest"],
2728
zip_safe=True,
2829
keywords=["ROS"],
2930
license="MIT",

bitbots_world_model/bitbots_robot_filter/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import glob
22

3-
from setuptools import setup
3+
from setuptools import find_packages, setup
44

55
package_name = "bitbots_robot_filter"
66

77
setup(
88
name=package_name,
99
version="0.0.0",
10-
packages=[package_name],
10+
packages=find_packages(exclude=["test"]),
1111
data_files=[
1212
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
1313
("share/" + package_name, ["package.xml"]),

scripts/ros.plugin.sh

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ alias cbs='cdc && colcon build --symlink-install --packages-select'
5454
alias cb='cdc && colcon build --symlink-install --continue-on-error --packages-up-to'
5555
alias cc='cdc && colcon clean packages --packages-select'
5656
alias cca='cdc && colcon clean packages'
57+
alias ct='cdc && colcon test --event-handlers console_direct+ --return-code-on-test-failure'
5758

5859
alias sr="source /opt/ros/$distro/setup.$shell && update_ros2_argcomplete"
5960
alias sc="source \$COLCON_WS/install/setup.$shell && update_ros2_argcomplete"

0 commit comments

Comments
 (0)