Skip to content

Commit

Permalink
Remove debug code
Browse files Browse the repository at this point in the history
Signed-off-by: Emerson Knapp <[email protected]>
  • Loading branch information
Emerson Knapp committed Mar 31, 2021
1 parent 4436975 commit 9290b44
Showing 1 changed file with 22 additions and 64 deletions.
86 changes: 22 additions & 64 deletions ros2topic/test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import launch_testing.asserts
import launch_testing.markers
import launch_testing.tools
import launch_testing.tools.text
import launch_testing_ros.tools

import pytest
Expand Down Expand Up @@ -189,7 +188,6 @@ def launch_topic_command(self, arguments):
output_filter=rmw_implementation_filter
)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_list_topics(self):
with self.launch_topic_command(arguments=['list']) as topic_command:
Expand All @@ -211,7 +209,6 @@ def test_list_topics(self):
strict=True
)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_list_all_topics(self):
with self.launch_topic_command(
Expand All @@ -236,7 +233,6 @@ def test_list_all_topics(self):
strict=True
)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_list_with_types(self):
with self.launch_topic_command(arguments=['list', '-t']) as topic_command:
Expand All @@ -258,7 +254,6 @@ def test_list_with_types(self):
strict=True
)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_list_count(self):
with self.launch_topic_command(arguments=['list', '-c']) as topic_command:
Expand All @@ -268,7 +263,6 @@ def test_list_count(self):
assert len(output_lines) == 1
assert int(output_lines[0]) == 9

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_topic_endpoint_info(self):
with self.launch_topic_command(arguments=['info', '/chatter']) as topic_command:
Expand All @@ -284,46 +278,33 @@ def test_topic_endpoint_info(self):
strict=True
)

# @launch_testing.markers.retry_on_failure(times=5)
@launch_testing.markers.retry_on_failure(times=5)
def test_topic_endpoint_info_verbose(self):

with self.launch_topic_command(arguments=['info', '-v', '/chatter']) as topic_command:
assert topic_command.wait_for_shutdown(timeout=10)
assert topic_command.exit_code == launch_testing.asserts.EXIT_OK
# print(topic_command.output)
expected_lines=[
'Type: std_msgs/msg/String',
'',
'Publisher count: 1',
'',
re.compile(r'Node name: \w+'),
'Node namespace: /',
'Topic type: std_msgs/msg/String',
re.compile(r'Endpoint type: (INVALID|PUBLISHER|SUBSCRIPTION)'),
re.compile(r'GID: [\w\.]+'),
'QoS profile:',
re.compile(r' Reliability: (RELIABLE|BEST_EFFORT|SYSTEM_DEFAULT|UNKNOWN)'),
re.compile(r' Durability: (VOLATILE|TRANSIENT_LOCAL|SYSTEM_DEFAULT|UNKNOWN)'),
' Lifespan: Infinite',
' Deadline: Infinite',
re.compile(r' Liveliness: (AUTOMATIC|MANUAL_BY_TOPIC|SYSTEM_DEFAULT|UNKNOWN)'),
' Liveliness lease duration: Infinite',
'',
'Subscription count: 0',
''
]
# actual_lines = topic_command.output.splitlines()
# for expected_line, actual_line in zip(expected_lines, actual_lines):
# if hasattr(expected_line, 'match'):
# assert expected_line.match(actual_line)
# else:
# assert expected_line == actual_line
# assert expected_line == actual_line
# match = launch_testing.tools.text.build_line_match(expected_line)
# assert match([actual_line], start=0) is not None

assert launch_testing.tools.expect_output(
expected_lines=expected_lines,
expected_lines=[
'Type: std_msgs/msg/String',
'',
'Publisher count: 1',
'',
re.compile(r'Node name: \w+'),
'Node namespace: /',
'Topic type: std_msgs/msg/String',
re.compile(r'Endpoint type: (INVALID|PUBLISHER|SUBSCRIPTION)'),
re.compile(r'GID: [\w\.]+'),
'QoS profile:',
re.compile(r' Reliability: (RELIABLE|BEST_EFFORT|SYSTEM_DEFAULT|UNKNOWN)'),
re.compile(r' Durability: (VOLATILE|TRANSIENT_LOCAL|SYSTEM_DEFAULT|UNKNOWN)'),
' Lifespan: Infinite',
' Deadline: Infinite',
re.compile(r' Liveliness: (AUTOMATIC|MANUAL_BY_TOPIC|SYSTEM_DEFAULT|UNKNOWN)'),
' Liveliness lease duration: Infinite',
'',
'Subscription count: 0',
''
],
text=topic_command.output,
strict=True
)
Expand All @@ -339,7 +320,6 @@ def test_info_on_unknown_topic(self):
strict=True
)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_topic_type(self):
with self.launch_topic_command(arguments=['type', '/chatter']) as topic_command:
Expand All @@ -351,7 +331,6 @@ def test_topic_type(self):
strict=True
)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_hidden_topic_type(self):
with self.launch_topic_command(
Expand All @@ -361,7 +340,6 @@ def test_hidden_topic_type(self):
assert topic_command.exit_code == 1
assert topic_command.output == ''

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_find_topic_type(self):
with self.launch_topic_command(
Expand All @@ -373,7 +351,6 @@ def test_find_topic_type(self):
expected_lines=['/rosout'], text=topic_command.output, strict=True
)

@unittest.skip('poop')
def test_find_not_a_topic_typename(self):
with self.launch_topic_command(
arguments=['find', 'rcl_interfaces/msg/NotAMessageTypeName']
Expand All @@ -382,7 +359,6 @@ def test_find_not_a_topic_typename(self):
assert topic_command.exit_code == launch_testing.asserts.EXIT_OK
assert not topic_command.output

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_topic_echo(self):
with self.launch_topic_command(
Expand All @@ -396,7 +372,6 @@ def test_topic_echo(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_no_str_topic_echo(self):
with self.launch_topic_command(
Expand All @@ -410,7 +385,6 @@ def test_no_str_topic_echo(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_csv_topic_echo(self):
with self.launch_topic_command(
Expand All @@ -423,7 +397,6 @@ def test_csv_topic_echo(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_no_arr_topic_echo_on_array_message(self):
with self.launch_topic_command(
Expand Down Expand Up @@ -468,7 +441,6 @@ def test_no_arr_topic_echo_on_array_message(self):
), timeout=10), 'Output does not match: ' + topic_command.output
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_no_arr_topic_echo_on_seq_message(self):
with self.launch_topic_command(
Expand Down Expand Up @@ -513,7 +485,6 @@ def test_no_arr_topic_echo_on_seq_message(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_no_arr_topic_echo_on_bounded_seq_message(self):
with self.launch_topic_command(
Expand Down Expand Up @@ -559,7 +530,6 @@ def test_no_arr_topic_echo_on_bounded_seq_message(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_truncate_length_topic_echo(self):
with self.launch_topic_command(
Expand All @@ -573,7 +543,6 @@ def test_truncate_length_topic_echo(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_topic_echo_field(self):
with self.launch_topic_command(
Expand All @@ -587,7 +556,6 @@ def test_topic_echo_field(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_topic_echo_field_nested(self):
with self.launch_topic_command(
Expand All @@ -603,7 +571,6 @@ def test_topic_echo_field_nested(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_topic_echo_field_not_a_member(self):
with self.launch_topic_command(
Expand All @@ -616,7 +583,6 @@ def test_topic_echo_field_not_a_member(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
def test_topic_echo_field_invalid(self):
with self.launch_topic_command(
arguments=['echo', '/arrays', '--field', '/'],
Expand All @@ -638,7 +604,6 @@ def test_topic_echo_field_invalid(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
def test_topic_echo_no_publisher(self):
with self.launch_topic_command(
arguments=['echo', '/this_topic_has_no_pub'],
Expand All @@ -653,7 +618,6 @@ def test_topic_echo_no_publisher(self):
strict=True
)

@unittest.skip('poop')
def test_topic_pub(self):
with self.launch_topic_command(
arguments=[
Expand All @@ -680,7 +644,6 @@ def test_topic_pub(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
def test_topic_pub_once(self):
with self.launch_topic_command(
arguments=[
Expand Down Expand Up @@ -708,7 +671,6 @@ def test_topic_pub_once(self):
), timeout=10)
assert topic_command.exit_code == launch_testing.asserts.EXIT_OK

@unittest.skip('poop')
def test_topic_pub_print_every_two(self):
with self.launch_topic_command(
arguments=[
Expand Down Expand Up @@ -738,7 +700,6 @@ def test_topic_pub_print_every_two(self):
), timeout=10)
assert topic_command.wait_for_shutdown(timeout=10)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_topic_delay(self):
average_delay_line_pattern = re.compile(r'average delay: (\d+.\d{3})')
Expand All @@ -757,7 +718,6 @@ def test_topic_delay(self):
average_delay = float(average_delay_line_pattern.match(head_line).group(1))
assert math.isclose(average_delay, 0.0, abs_tol=10e-3)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_topic_hz(self):
average_rate_line_pattern = re.compile(r'average rate: (\d+.\d{3})')
Expand All @@ -776,7 +736,6 @@ def test_topic_hz(self):
average_rate = float(average_rate_line_pattern.match(head_line).group(1))
assert math.isclose(average_rate, 1., rel_tol=1e-2)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_filtered_topic_hz(self):
average_rate_line_pattern = re.compile(r'average rate: (\d+.\d{3})')
Expand All @@ -802,7 +761,6 @@ def test_filtered_topic_hz(self):
average_rate = float(average_rate_line_pattern.match(head_line).group(1))
assert math.isclose(average_rate, 0.5, rel_tol=1e-2)

@unittest.skip('poop')
@launch_testing.markers.retry_on_failure(times=5, delay=1)
def test_topic_bw(self):
with self.launch_topic_command(arguments=['bw', '/defaults']) as topic_command:
Expand Down

0 comments on commit 9290b44

Please sign in to comment.