Skip to content

Commit

Permalink
test(colcon): configure our pkgs to use pytest
Browse files Browse the repository at this point in the history
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
  • Loading branch information
texhnolyze committed Dec 12, 2024
1 parent 1cd061d commit ef65537
Show file tree
Hide file tree
Showing 24 changed files with 45 additions and 16 deletions.
1 change: 1 addition & 0 deletions bitbots_behavior/bitbots_body_behavior/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<depend>tf_transformations</depend>
<depend>tf2</depend>

<test_depend>python3-pytest</test_depend>

<export>
<rosdoc config="rosdoc.yaml"/>
Expand Down
4 changes: 2 additions & 2 deletions bitbots_behavior/bitbots_body_behavior/setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import glob

from setuptools import setup
from setuptools import find_packages, setup

package_name = "bitbots_body_behavior"


setup(
name=package_name,
packages=[package_name],
packages=find_packages(exclude=["test"]),
data_files=[
("share/" + package_name, ["package.xml"]),
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
Expand Down
1 change: 1 addition & 0 deletions bitbots_misc/bitbots_technical_challenge_vision/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
("share/" + package_name + "/launch", glob.glob("launch/*.launch")),
],
install_requires=["setuptools"],
tests_require=["pytest"],
zip_safe=True,
maintainer="par",
maintainer_email="[email protected]",
Expand Down
2 changes: 2 additions & 0 deletions bitbots_misc/bitbots_teleop/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<depend>std_msgs</depend>
<depend>tf_transformations</depend>

<test_depend>python3-pytest</test_depend>

<export>
<bitbots_documentation>
<language>python2</language>
Expand Down
1 change: 1 addition & 0 deletions bitbots_misc/bitbots_teleop/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"launch",
"setuptools",
],
tests_require=["pytest"],
zip_safe=True,
keywords=["ROS"],
license="MIT",
Expand Down
4 changes: 3 additions & 1 deletion bitbots_misc/bitbots_tts/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<maintainer email="[email protected]">Hamburg Bit-Bots</maintainer>

<license>MIT</license>

<author email="[email protected]">Marc Bestmann</author>

<buildtool_depend>ament_cmake</buildtool_depend>
Expand All @@ -21,6 +21,8 @@
<depend>espeak</depend>
<depend>std_msgs</depend>

<test_depend>python3-pytest</test_depend>

<export>
<bitbots_documentation>
<status>broken</status>
Expand Down
3 changes: 2 additions & 1 deletion bitbots_misc/bitbots_tts/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name=package_name,
packages=find_packages(),
packages=find_packages(exclude=["test"]),
data_files=[
("share/" + package_name, ["package.xml"]),
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
Expand All @@ -16,6 +16,7 @@
install_requires=[
"setuptools",
],
tests_require=["pytest"],
scripts=glob.glob("scripts/*"),
entry_points={
"console_scripts": [
Expand Down
9 changes: 6 additions & 3 deletions bitbots_misc/system_monitor/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<maintainer email="[email protected]">Hamburg Bit-Bots</maintainer>

<license>MIT</license>

<author email="[email protected]">Finn-Thorben Sell</author>

<buildtool_depend>ament_cmake</buildtool_depend>
Expand All @@ -21,7 +21,10 @@
<depend>rclpy</depend>
<depend>bitbots_msgs</depend>

<export><build_type>ament_python</build_type>
<test_depend>python3-pytest</test_depend>

<export>
<build_type>ament_python</build_type>
</export>

</package>
</package>
3 changes: 2 additions & 1 deletion bitbots_misc/system_monitor/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name=package_name,
packages=find_packages(),
packages=find_packages(exclude=["test"]),
data_files=[
("share/" + package_name, ["package.xml"]),
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
Expand All @@ -18,6 +18,7 @@
install_requires=[
"setuptools",
],
tests_require=["pytest"],
entry_points={
"console_scripts": [
"monitor = system_monitor.monitor:main",
Expand Down
2 changes: 2 additions & 0 deletions bitbots_motion/bitbots_animation_rqt/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<exec_depend>rqt_gui</exec_depend>
<exec_depend>std_srvs</exec_depend>

<test_depend>python3-pytest</test_depend>

<export>
<architecture_independent/>
<rqt_gui plugin="${prefix}/plugin.xml"/>
Expand Down
3 changes: 2 additions & 1 deletion bitbots_motion/bitbots_animation_rqt/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

setup(
name=package_name,
packages=find_packages(),
packages=find_packages(exclude=["test"]),
data_files=[
("share/" + package_name + "/resource", ["resource/RecordUI.ui"]),
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
("share/" + package_name, ["package.xml"]),
("share/" + package_name, ["plugin.xml"]),
],
install_requires=["setuptools"],
tests_require=["pytest"],
zip_safe=True,
entry_points={
"console_scripts": [
Expand Down
2 changes: 2 additions & 0 deletions bitbots_motion/bitbots_animation_server/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<depend>rclpy</depend>
<depend>std_msgs</depend>

<test_depend>python3-pytest</test_depend>

<export>
<bitbots_documentation>
<status>tested_integration</status>
Expand Down
1 change: 1 addition & 0 deletions bitbots_motion/bitbots_animation_server/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"launch",
"setuptools",
],
tests_require=["pytest"],
zip_safe=True,
keywords=["ROS"],
license="MIT",
Expand Down
2 changes: 2 additions & 0 deletions bitbots_simulation/bitbots_robocup_api/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<depend>topic_tools</depend>
<depend>rosbag2</depend>

<test_depend>python3-pytest</test_depend>

<export>
<build_type>ament_python</build_type>
<bitbots_documentation>
Expand Down
3 changes: 2 additions & 1 deletion bitbots_simulation/bitbots_robocup_api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name=package_name,
packages=find_packages(),
packages=find_packages(exclude=["test"]),
data_files=[
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
(os.path.join("share", package_name), ["package.xml"]),
Expand All @@ -18,6 +18,7 @@
"launch",
"setuptools",
],
tests_require=["pytest"],
zip_safe=True,
keywords=["ROS"],
license="MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
install_requires=[
"setuptools",
],
extras_require={
"dev": ["pytest", "syrupy"],
},
tests_require=["pytest", "syrupy"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<exec_depend>rqt_gui</exec_depend>
<exec_depend>std_srvs</exec_depend>

<test_depend>python3-pytest</test_depend>

<export>
<architecture_independent/>
<rqt_gui plugin="${prefix}/plugin.xml"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

setup(
name=package_name,
packages=find_packages(),
packages=find_packages(exclude=["test"]),
data_files=[
("share/" + package_name + "/resource", ["resource/RobotTeamDataSimulator.ui"]),
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
("share/" + package_name, ["package.xml"]),
("share/" + package_name, ["plugin.xml"]),
],
install_requires=["setuptools"],
tests_require=["pytest"],
zip_safe=True,
entry_points={
"console_scripts": [
Expand Down
2 changes: 2 additions & 0 deletions bitbots_vision/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
<depend>std_msgs</depend>
<depend>vision_opencv</depend>

<test_depend>python3-pytest</test_depend>

<export>
<bitbots_documentation>
<language>python3</language>
Expand Down
1 change: 1 addition & 0 deletions bitbots_vision/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"launch",
"setuptools",
],
tests_require=["pytest"],
zip_safe=True,
keywords=["ROS"],
license="MIT",
Expand Down
2 changes: 2 additions & 0 deletions bitbots_world_model/bitbots_ball_filter/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
<depend>std_srvs</depend>
<depend>tf2_geometry_msgs</depend>

<test_depend>python3-pytest</test_depend>

<export>
<bitbots_documentation>
<language>python3</language>
Expand Down
1 change: 1 addition & 0 deletions bitbots_world_model/bitbots_ball_filter/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"launch",
"setuptools",
],
tests_require=["pytest"],
zip_safe=True,
keywords=["ROS"],
license="MIT",
Expand Down
4 changes: 2 additions & 2 deletions bitbots_world_model/bitbots_robot_filter/setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import glob

from setuptools import setup
from setuptools import find_packages, setup

package_name = "bitbots_robot_filter"

setup(
name=package_name,
version="0.0.0",
packages=[package_name],
packages=find_packages(exclude=["test"]),
data_files=[
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
("share/" + package_name, ["package.xml"]),
Expand Down
1 change: 1 addition & 0 deletions scripts/ros.plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ alias cbs='cdc && colcon build --symlink-install --packages-select'
alias cb='cdc && colcon build --symlink-install --continue-on-error --packages-up-to'
alias cc='cdc && colcon clean packages --packages-select'
alias cca='cdc && colcon clean packages'
alias ct='cdc && colcon test --event-handlers console_direct+ --return-code-on-test-failure'

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

0 comments on commit ef65537

Please sign in to comment.