-
Notifications
You must be signed in to change notification settings - Fork 118
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
Fix pytest-cov version detection with pytest >=7.0.0 #436
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.
|
No :( @haudren-woven you can always just cherry-pick this onto |
@Mergifyio backport humble |
✅ Backports have been created
|
Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai> (cherry picked from commit 62208eb)
I noticed that
pytest-cov
wasn't detected properly, even ifpython3-pytest-cov
is installed. See for exampletest_tracetools
here: 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
pytest
used to be printed to stderr (which was a bit weird, I admit), it's now printed to stdout sincepytest
version 7.0.0: pytest-dev/pytest#8247. See the difference betweenpytest
7.2.2 (frompip
) andpytest
6.2.5 (from system packages):Therefore, just search for the
pytest-cov
version in both stdout and stderr. This works (i.e., gets rid of the warning) locally.