Skip to content
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

Don't pass COV_CORE_SOURCE to python build subprocess #579

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented Sep 5, 2023

It appears that when this varible is set, pytest-cov will import modules during the interpreter initialization before the sitecustomize hook runs. Among the modules imported is sysconfig, which caches its global state before we're able to modify it, thus rendering the entire hook unusable.

The documentation for the 'site' module has more details here, but I wasn't able to find a more aggressive way to prioritize our hook over others. For now, we should suppress COV_CORE_SOURCE to unblock new tests in colcon itself.

@cottsay cottsay added the bug Something isn't working label Sep 5, 2023
@cottsay cottsay self-assigned this Sep 5, 2023
It appears that when this varible is set, pytest-cov will import modules
during the interpreter initialization before the sitecustomize hook
runs. Among the modules imported is sysconfig, which caches its global
state before we're able to modify it, thus rendering the entire hook
unusable.

The documentation for the 'site' module has more details here, but I
wasn't able to find a more aggressive way to prioritize our hook over
others. For now, we should suppress COV_CORE_SOURCE to unblock new tests
in colcon itself.
@cottsay cottsay force-pushed the cottsay/no-cov-subprocess branch from 57cdf3e to 4f443be Compare September 5, 2023 16:13
@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (3241f1c) 81.94% compared to head (e368e5e) 81.95%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #579   +/-   ##
=======================================
  Coverage   81.94%   81.95%           
=======================================
  Files          65       65           
  Lines        3756     3757    +1     
  Branches      724      724           
=======================================
+ Hits         3078     3079    +1     
  Misses        622      622           
  Partials       56       56           
Files Changed Coverage Δ
colcon_core/task/python/build.py 41.37% <100.00%> (+0.29%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@nuclearsandwich nuclearsandwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved but set a few questions that can be resolved or not at your discretion.

@cottsay cottsay merged commit 5c8c498 into master Sep 13, 2023
@delete-merged-branch delete-merged-branch bot deleted the cottsay/no-cov-subprocess branch September 13, 2023 19:28
@cottsay cottsay added this to the 0.13.0 milestone Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants