Fix pytest-cov version detection with pytest >=7.0.0#436
Conversation
Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
Note that, while this checks for build failures, it will not validate this fix.
However, it did work locally for me, so perhaps that's enough, functionality-wise. Ideally, a test would've caught this regression (because it is one), but this isn't really straightforward to test. |
I'll note that you can specify arbitrary options to those CI jobs, so you could enable it as a colcon |
|
Looks good:
|
|
@clalancette : I just hit this particular issue on Humble, is there any chance to backport this? |
|
This should be backportable to Humble. Let's see if the bot will let me do it: |
|
@Mergifyio backport humble |
❌ Command disallowed due to command restrictions in the Mergify configuration.Details
|
|
No :( @haudren-woven you can always just cherry-pick this onto |
|
@Mergifyio backport humble |
✅ Backports have been createdDetails
|
Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai> (cherry picked from commit 62208eb)
I noticed that
pytest-covwasn't detected properly, even ifpython3-pytest-covis installed. See for exampletest_tracetoolshere: https://build.ros2.org/job/Rpr__ros2_tracing__ubuntu_jammy_amd64/63/consoleFull#console-section-56I tested it locally and I got the same warning, but I know this used to work just fine.
Turns out that, while the plugin information printed by
pytestused to be printed to stderr (which was a bit weird, I admit), it's now printed to stdout sincepytestversion 7.0.0: pytest-dev/pytest#8247. See the difference betweenpytest7.2.2 (frompip) andpytest6.2.5 (from system packages):Therefore, just search for the
pytest-covversion in both stdout and stderr. This works (i.e., gets rid of the warning) locally.