ros2 / launch

Tools for launching multiple processes and for writing tests involving multiple processes.
Apache License 2.0
124 stars 139 forks source link

Inherit markers from generate_test_description #670

Closed cottsay closed 1 year ago

cottsay commented 1 year ago

As it stands, pytest sees launch tests as a single testing node with no markings. It would be useful if normal pytest markings could be used on the generate_test_description function (where @pytest.mark.launch_test and @launch_testing.parametrize are currently specified).

Notably, this will always mark the test nodes with 'launch_test', and will allow the use of very useful marking like 'xfail', 'skip', and 'skipif'.

To duplicate the markers from the entrypoint, this change makes use of the MarkerGenerator singleton (aka pytest.mark) to create a new MarkerDecorator with the same name, then copies the original marker's arguments, which are critical for markers like skipif.

Complements ros2/launch_ros#330

cottsay commented 1 year ago
methylDragon commented 1 year ago

Rebuilding rhel: * Linux-rhel Build Status

The instability is on the nightlies too: https://ci.ros2.org/view/nightly/job/nightly_linux-rhel_release/1323/testReport/

cottsay commented 1 year ago

@mergifyio backport humble

cottsay commented 1 year ago

@mergifyio backport galactic

mergify[bot] commented 1 year ago

backport humble

✅ Backports have been created

* [#674 Inherit markers from generate_test_description (backport #670)](https://github.com/ros2/launch/pull/674) has been created for branch `humble`
mergify[bot] commented 1 year ago

backport galactic

✅ Backports have been created

* [#675 Inherit markers from generate_test_description (backport #670)](https://github.com/ros2/launch/pull/675) has been created for branch `galactic`