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

Update colcon_core.command for generalized usage #651

Merged
merged 1 commit into from
May 31, 2024

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented May 31, 2024

These non-breaking API changes are helpful for creating other CLIs based on colcon's extension model.

These non-breaking API changes are helpful for creating other CLIs based
on colcon's extension model.
@cottsay cottsay added the enhancement New feature or request label May 31, 2024
@cottsay cottsay self-assigned this May 31, 2024
Copy link

codecov bot commented May 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.27%. Comparing base (86eb33b) to head (4de2864).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #651      +/-   ##
==========================================
+ Coverage   83.24%   83.27%   +0.03%     
==========================================
  Files          66       66              
  Lines        3849     3856       +7     
  Branches      760      762       +2     
==========================================
+ Hits         3204     3211       +7     
  Misses        556      556              
  Partials       89       89              

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

'environment variable' in str(e.value)
assert load.call_count == 0
finally:
override_blocklist_variable(None)
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Precisely. First 2 checks makes sure that the override actually switched what variable the extension point subsystem is looking at, and the last check makes sure that the "reset to default" behavior works as expected. Also, because this changes globals, we don't want this test run to mess up other tests, so best to return it to the defaults.

I wanted to use a patch to "sandbox" this test a little more, but I'm pretty sure that the override will simply replace the mock.

@cottsay cottsay marked this pull request as ready for review May 31, 2024 21:18
@cottsay cottsay merged commit 37dc1dd into master May 31, 2024
36 checks passed
@delete-merged-branch delete-merged-branch bot deleted the cottsay/generalized-cli branch May 31, 2024 21:19
@cottsay cottsay added this to the 0.16.2 milestone Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants