Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI while running in ROS 2 Jazzy environment. #351

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion zenoh-plugin-ros2dds/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,8 +942,11 @@ mod tests {
config: &str,
result: Option<RosAutomaticDiscoveryRange>,
) {
// Avoid the current environmental variables affect the result
// In ROS 2 Jazzy environment, ROS_AUTOMATIC_DISCOVERY_RANGE will be set to SUBNET automatically
// This will cause the empty config test fail.
std::env::remove_var("ROS_AUTOMATIC_DISCOVERY_RANGE");
let config = serde_json::from_str::<Config>(config);
println!(">>> {:?}", config);
assert!(config.is_ok());
let Config {
ros_automatic_discovery_range,
Expand All @@ -956,6 +959,8 @@ mod tests {
#[test_case(r#"{"ros_static_peers": "127.0.0.1"}"#, Some(vec!["127.0.0.1".to_owned()]); "Single peer")]
#[test_case(r#"{"ros_static_peers": "192.168.1.1;192.168.1.2"}"#, Some(vec!["192.168.1.1".to_owned(), "192.168.1.2".to_owned()]); "Multiple peers")]
fn test_ros_static_peers(config: &str, result: Option<Vec<String>>) {
// Avoid the current environmental variables affect the result
std::env::remove_var("ROS_STATIC_PEERS");
let config = serde_json::from_str::<Config>(config);
assert!(config.is_ok());
let Config {
Expand Down
Loading