Skip to content

Commit

Permalink
Fix CI while running in ROS 2 Jazzy environment.
Browse files Browse the repository at this point in the history
Signed-off-by: ChenYing Kuo <[email protected]>
  • Loading branch information
evshary committed Dec 3, 2024
1 parent c496bbb commit d858fcc
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit d858fcc

Please sign in to comment.