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

Improve 'ros2 trace' command error handling & add end-to-end tests #54

Conversation

christophebedard
Copy link
Member

@christophebedard christophebedard commented Apr 6, 2023

Closes #26

Closes #36

This improves error handling and error report in tracetools_trace. The common functions used by ros2trace (for the ros2 trace command) and tracetools_launch (for the Trace launch action) now do not print anything; they raise exceptions where appropriate. Then, ros2 trace/Trace can catch any error and report it using the appropriate method: print to stderr for ros2 trace and log error for Trace.

This also makes sure to destroy the tracing session if it exists when tracing configuration fails.

Finally, this adds end-to-end tests for the ros2 trace command to cover the main cases. It also improves parameter validation for the session name.

Signed-off-by: Christophe Bedard christophe.bedard@apex.ai

@christophebedard christophebedard added the enhancement New feature or request label Apr 6, 2023
@christophebedard christophebedard self-assigned this Apr 6, 2023
@christophebedard christophebedard force-pushed the christophebedard/ros2-trace-command-end-to-end-tests-and-improvements branch from 969bd22 to e3ccea0 Compare April 6, 2023 20:56
@christophebedard christophebedard force-pushed the christophebedard/ros2-trace-command-end-to-end-tests-and-improvements branch 2 times, most recently from f2f16f0 to c3d1004 Compare April 6, 2023 22:10
@christophebedard
Copy link
Member Author

Hmm maybe these tests shouldn't rely on tracepoints being included. Or maybe they could be skipped if tracepoints are not included.

@christophebedard christophebedard force-pushed the christophebedard/ros2-trace-command-end-to-end-tests-and-improvements branch from c3d1004 to e4c037f Compare April 7, 2023 16:21
@christophebedard
Copy link
Member Author

Or maybe they could be skipped if tracepoints are not included.

I did this.

@christophebedard christophebedard force-pushed the christophebedard/ros2-trace-command-end-to-end-tests-and-improvements branch 3 times, most recently from 90648ca to dd219e3 Compare April 8, 2023 19:25
@christophebedard christophebedard force-pushed the christophebedard/ros2-trace-command-end-to-end-tests-and-improvements branch from dd219e3 to f4ad3f3 Compare April 10, 2023 20:45
@christophebedard christophebedard force-pushed the christophebedard/ros2-trace-command-end-to-end-tests-and-improvements branch 4 times, most recently from 9c863ac to e789b18 Compare April 14, 2023 16:52
@christophebedard
Copy link
Member Author

christophebedard commented Apr 17, 2023

Testing --packages-above ros2trace tracetools_launch tracetools_trace:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
@christophebedard christophebedard force-pushed the christophebedard/ros2-trace-command-end-to-end-tests-and-improvements branch from e789b18 to ed7c144 Compare April 17, 2023 23:38
@christophebedard christophebedard changed the title Improve 'ros2 trace' command error handling and add end-to-end tests Improve 'ros2 trace' command error handling & add end-to-end tests Apr 18, 2023
@christophebedard christophebedard merged commit ecf7e0a into rolling Apr 18, 2023
@christophebedard christophebedard deleted the christophebedard/ros2-trace-command-end-to-end-tests-and-improvements branch April 18, 2023 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants