Launch testing concept and guide page#1914
Draft
adityapande-1995 wants to merge 8 commits intorollingfrom
Draft
Conversation
Signed-off-by: Aditya Pande <aditya050995@gmail.com>
Signed-off-by: Aditya Pande <aditya050995@gmail.com>
Signed-off-by: Aditya Pande <aditya050995@gmail.com>
audrow
reviewed
Sep 9, 2021
Member
audrow
left a comment
There was a problem hiding this comment.
I added some early feedback. It will be good to have this information documented! Let me know if you have any questions on my suggestions.
| Active Tests | ||
| ------------ | ||
|
|
||
| Any classes that inherit from ``unittest.TestCase`` and not decorated with the ``@post_shutdown_test`` descriptor will be run concurrently with the process under test. |
Member
There was a problem hiding this comment.
Suggested change
| Any classes that inherit from ``unittest.TestCase`` and not decorated with the ``@post_shutdown_test`` descriptor will be run concurrently with the process under test. | |
| Any classes that inherit from ``unittest.TestCase`` and are not decorated with the ``@post_shutdown_test`` descriptor will be run concurrently with the process under test. |
| ------------ | ||
|
|
||
| Any classes that inherit from ``unittest.TestCase`` and not decorated with the ``@post_shutdown_test`` descriptor will be run concurrently with the process under test. | ||
| These tests are expected to interact with the running processes in some way. The tests inside a fixture (class) do not run in any specific order. For e.g, in the ``TestFixture_1`` class in the above template, it is not guaranteed that ``test_1`` will run before ``test_2`` or vice versa. |
Member
There was a problem hiding this comment.
Suggested change
| These tests are expected to interact with the running processes in some way. The tests inside a fixture (class) do not run in any specific order. For e.g, in the ``TestFixture_1`` class in the above template, it is not guaranteed that ``test_1`` will run before ``test_2`` or vice versa. | |
| These tests are expected to interact with the running processes in some way. The tests inside a fixture (class) do not run in any specific order. For example, in the ``TestFixture_1`` class in the above template, it is not guaranteed that ``test_1`` will run before ``test_2`` or vice versa. |
"e.g.," means "for example," so you wouldn't need the "for," however, I think it's better to just write the whole thing out. Typically, you see "e.g." in parentheses.
| List of available assertions in ``launch_testing`` and their explanations can be found here. <TODO> | ||
| Most of the actions in ``launch.actions`` and ``launch_ros.actions`` can be used with launch testing. <TODO : Add links> | ||
|
|
||
| PYTHONUNBUFFERED environment variable |
Member
There was a problem hiding this comment.
I rather have a description of the effect of setting the variable in the title than the variable name. For example,
Suggested change
| PYTHONUNBUFFERED environment variable | |
| Reading stdout to console during testing |
|
|
||
| Context and handler objects | ||
| --------------------------- | ||
| The ``launch_testing`` framework has a "context" dictionary that is passed to the test cases. The ``proc_info`` and ``proc_output`` members a added automatically by the framework so that the tests can access process output and exit codes. |
Member
There was a problem hiding this comment.
Suggested change
| The ``launch_testing`` framework has a "context" dictionary that is passed to the test cases. The ``proc_info`` and ``proc_output`` members a added automatically by the framework so that the tests can access process output and exit codes. | |
| The ``launch_testing`` framework has a "context" dictionary that is passed to the test cases. The ``proc_info`` and ``proc_output`` members are added automatically by the framework so that the tests can access process output and exit codes. |
| * ``self.proc_info`` - a `ProcInfoHandler object <https://github.com/ros2/launch/blob/master/launch_testing/launch_testing/proc_info_handler.py>`__ | ||
| * ``self.proc_output`` - an `IoHandler object <https://github.com/ros2/launch/blob/master/launch_testing/launch_testing/io_handler.py>`__ | ||
|
|
||
| These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output. |
Member
There was a problem hiding this comment.
Suggested change
| These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output. | |
| These objects provide dictionary-like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output. |
ivanpauno
reviewed
Sep 10, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to add a guide and launch page for
launch_testingand improve the relevant documentation in general.Status: In progress
TODO
IOHandlerobjects, include example snippetsMain issue tracking the relevant PRs :
launch_testingdocumentation improvement plan launch#531