-
Notifications
You must be signed in to change notification settings - Fork 227
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
Avoid the limitation of not being able to import rclpy C extensions at module level #417
Conversation
…t module level Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
The referenced test passed? |
Sorry, wrong link. Updated post. |
Still referencing a passed test. |
The original link shows the regression https://ci.ros2.org/view/nightly/job/nightly_win_deb/1366/testReport/junit/(root)/projectroot/test_client/, but it can also be seen everywhere in CI. There's ros2/build_farmer#235 tracking it. |
There's something weird in the links, when I enter the first time, they show the regression and the error message. It happened again with @hidmic link .... |
The grouping of the tests is looking well after this patch, see: |
import rclpy.impl # noqa | ||
import test_rclpy # noqa | ||
# this will load rclpy from the build folder | ||
sys.path.insert(0, os.environ.get('RCLPY_TEST_LIBRARY_DIR')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivanpauno using that envvar is so shady... there has to be a natural way to do this. I wonder what setuptools
does under the hood when installing a regular Python package.
If you look at the list of tests (https://ci.ros2.org/view/nightly/job/nightly_win_deb/1366/testReport/junit/(root)/projectroot/) you will find that there are three test results named |
That's really inconvenient. This other doesn't have a repeated name:
The current solution is also shady ... |
More like not smart naming of our tests. All three tests have the same name:
Giving them more precise and therefore unique names would resolve this. |
Closing, because this is outdated. |
Kind of reverting the old #147, plus solving the "not nice grouping" problem in another way.
See discussion: #413 (comment)
There's some new nightly failures that are somewhat related with this problem, eg:
https://ci.ros2.org/view/nightly/job/nightly_win_rel/1302/testReport/junit/(root)/projectroot/test_client/
Basically, a pytest plugin is trying to import the C extensions before we "hack" the import in
__init__.py
file of the test directory.This PR doesn't solve that problem.
I'm not to sure why this is only hitting as on Windows.
There are some possible solutions: