Skip to content

Conversation

@EzraBrooks
Copy link
Contributor

@EzraBrooks EzraBrooks commented Nov 8, 2025

Public API Changes

None.

Description

  • Adds support for testing against ROS 2
  • Adds humble, jazzy, and kilted to the test matrix in CI
  • Disables ROS-1-only tests when running against distros other than noetic
  • Rewrote some tests that were way too timing-sensitive. Changed the way they asserted on their output, but left the assertions the same.

Closes #746

Comment on lines -4 to -15
const expectedTopics = [
/*
* '/turtle1/cmd_vel', '/turtle1/color_sensor', '/turtle1/pose',
* '/turtle2/cmd_vel', '/turtle2/color_sensor', '/turtle2/pose',
*/
"/tf2_web_republisher/status",
"/tf2_web_republisher/feedback",
// '/tf2_web_republisher/goal', '/tf2_web_republisher/result',
"/fibonacci/feedback",
"/fibonacci/status",
"/fibonacci/result",
];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test data is ROS-1-only and wasn't even sensical.. it didn't check for the one thing unique to our test suites, the /listener topic 🤦🏻‍♂️

@EzraBrooks

This comment was marked as outdated.

@EzraBrooks

This comment was marked as resolved.

@EzraBrooks EzraBrooks marked this pull request as draft November 8, 2025 21:42
@EzraBrooks

This comment was marked as resolved.

@EzraBrooks EzraBrooks changed the base branch from develop to reenable-mistakenly-disabled-integration-tests November 8, 2025 23:13
@EzraBrooks EzraBrooks force-pushed the add-ros2-integration-tests branch from 496132e to e05d367 Compare November 8, 2025 23:13
@EzraBrooks
Copy link
Contributor Author

https://github.com/RobotWebTools/roslibjs/actions/runs/19199950081/job/54886332135?pr=1024#step:6:82

Caught the malformed JSON bug in the wild in one of the Humble jobs @bjsowa @sea-bass

Base automatically changed from reenable-mistakenly-disabled-integration-tests to develop November 8, 2025 23:51
@EzraBrooks EzraBrooks force-pushed the add-ros2-integration-tests branch from 16c97c9 to 5bad2c5 Compare November 8, 2025 23:51
@bjsowa
Copy link
Member

bjsowa commented Nov 9, 2025

@EzraBrooks It seems some tests related to Parameters are failing. Just FYI, I reimplemented the params module in rosapi at some point (RobotWebTools/rosbridge_suite#1001) but did not backport it to humble, so they may behave slightly different.

@EzraBrooks EzraBrooks force-pushed the add-ros2-integration-tests branch 2 times, most recently from 9ebdad7 to 9914ed3 Compare November 9, 2025 19:49
@EzraBrooks
Copy link
Contributor Author

EzraBrooks commented Nov 9, 2025

Now we're into race-condition-land, because some of these Humble tests pass locally on my machine. I'll try cranking up their timeouts, since the default runners on GitHub Actions are tiny dual-core things.

edit: turns out the getParams call was hanging the bridge, which was failing random other tests.

Comment on lines +45 to +46
// Known issue with getting params being able to hang in Humble because it had no timeout.
// This doesn't even work with `ros2 param list` at the CLI in our test environment :(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi

<launch>
<!-- Include rosbridge websocket launch file for ROS 2 -->
<include file="$(find-pkg-share rosbridge_server)/launch/rosbridge_websocket_launch.xml">
<arg name="call_services_in_new_thread" value="true"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turns out our tests accidentally depend on this behavior which was not default in humble

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe leave a comment related to this so that when humble goes eol someone can see this and delete it

I'd also enable the action equivalent param send_action_goals_in_new_thread (going off memory) for the same reason

@EzraBrooks

This comment was marked as resolved.

@EzraBrooks EzraBrooks force-pushed the add-ros2-integration-tests branch from 53f73c9 to 0636126 Compare November 9, 2025 20:35
@EzraBrooks
Copy link
Contributor Author

With how much duplicated effort is going on here, I think roslibjs 2.x should be the final major release to support ROS 1.

I think there are a lot of great improvements in 2.0 that we should provide the ROS 1 users, but we should move on pretty quickly to a 3.0 that has no ROS 1 support.

@EzraBrooks
Copy link
Contributor Author

I enabled testing on rolling and then immediately disabled it because something outside my control was broken. Sorry, not gonna happen - at least not right now.

@EzraBrooks EzraBrooks marked this pull request as ready for review November 9, 2025 20:54
@EzraBrooks EzraBrooks requested review from bjsowa and sea-bass November 9, 2025 20:54
@sea-bass
Copy link
Contributor

sea-bass commented Nov 9, 2025

I enabled testing on rolling and then immediately disabled it because something outside my control was broken. Sorry, not gonna happen - at least not right now.

It just seems like whatever ros version is being used in the backend for the rolling test doesn't contain this change

ros2/rosidl#887

@sea-bass
Copy link
Contributor

sea-bass commented Nov 9, 2025

It honestly may get easily fixed by doing an apt-get upgrade here:

apt-get update && \

Although that has implications for caching, of course. Ideally the docker image is just up to date lol

https://hub.docker.com/layers/library/ros/rolling-ros-base/images/sha256-c61fdc63cea06cdd8f60b18946b68f880d874335e1d20cc0d1314dda5fbc8753

@EzraBrooks
Copy link
Contributor Author

I'm still not a fan of having my code be tested against the unstable branch of someone else's code, regardless.

@sea-bass
Copy link
Contributor

sea-bass commented Nov 9, 2025

I'm still not a fan of having my code be tested against the unstable branch of someone else's code, regardless.

The usual model (at least that makes sense to me) is to have rolling in CI so you get the early feedback, but not having it be a required check to pass

@EzraBrooks
Copy link
Contributor Author

And therein lies the problem where people in the ROS community become inoculated to the sight of failing CI jobs.

imo, next steps for the tests in this repo are to eliminate all the dependencies other than rosbridge_websocket and tf2_web_republisher, and then maybe at that point we could test against rolling since they're "our code".

Copy link
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woof, you are right the ros 1/2 branching logic is something we should seek to get rid of. Nice job figuring all that out though.

const PARAM_NAME =
process.env.ROS_DISTRO === "noetic"
? "/test/foo"
: // Is it crazy to muck around with use_sim_time here? I feel like it shouldn't matter..
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine IMO

<launch>
<!-- Include rosbridge websocket launch file for ROS 2 -->
<include file="$(find-pkg-share rosbridge_server)/launch/rosbridge_websocket_launch.xml">
<arg name="call_services_in_new_thread" value="true"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe leave a comment related to this so that when humble goes eol someone can see this and delete it

I'd also enable the action equivalent param send_action_goals_in_new_thread (going off memory) for the same reason

@sea-bass
Copy link
Contributor

sea-bass commented Nov 9, 2025

imo, next steps for the tests in this repo are to eliminate all the dependencies other than rosbridge_websocket and tf2_web_republisher, and then maybe at that point we could test against rolling since they're "our code".

These packages won't be able to easily stop depending on "core" libraries like rclpy or rosidl (which is what is failing atm), so this might not be super feasible.

But you're right, I don't think it's unreasonable to simply not test rolling. It means less risk of "red is okay" but also means by the time a new stable distro is cut the number of surprises has potentially amassed.

@EzraBrooks
Copy link
Contributor Author

I think it's easier to squash all the bugs at once than it is to be stressed out from random CI fires for a year ;)

@EzraBrooks EzraBrooks enabled auto-merge (squash) November 9, 2025 21:14
@EzraBrooks EzraBrooks merged commit 87b9383 into develop Nov 9, 2025
12 checks passed
@EzraBrooks EzraBrooks deleted the add-ros2-integration-tests branch November 9, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ROS 2 integration tests

4 participants