Skip to content

Conversation

@sirosen
Copy link
Member

@sirosen sirosen commented Dec 23, 2025

Examining coverage reports for the CLI shows that there are several large untested blobs.
A case-by-case evaluation reveals that several of these can be improved dramatically with minimal effort.

  1. Remove dead code (unused helpers, etc)
  2. Exclude the local flake8 plugin from unit tests
  3. Unit test --map-http-status
  4. Unit test IdentityType
  5. Unit test globus version

Only this last item (globus version) required any meaningful change in the src tree, as it uncovered a deprecation warning when globus version -v is run.
The fix is simply an update to use importlib.metadata to retrieve package version info.

This is an unused module which is never even tested.
This helper is no longer used and not covered in tests.
'display_name_or_cname' is only used in one place and can be made into
a single line, inlined at the usage site.
This option was previously untested, but allows commands to rewrite the
exit status which will be used by top-level exception handlers, based on
the HTTP status of the underlying (failing) response.
These unit tests cover previously uncovered code.
Explore the features of `globus version`, including the diagnostic output
provided with `-v` and `-vv`.

In the course of these tests, deprecation warnings were uncovered related
to use of `click.__version__`. Therefore, upgrade the command to use
`importlib.metadata` instead.
@sirosen sirosen added the no-news-is-good-news This change does not require a news file label Dec 23, 2025
patch = ["subprocess"]
source = ["globus_cli"]
omit = [
"globus_cli_flake8.py",
Copy link
Member

Choose a reason for hiding this comment

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

I have a feeling this shouldn't be in the src/ tree to begin with, but this is currently a helpful omission!

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I can understand that. In SDK we put the sphinx stuff (similar) into src/globus_sdk/_internal/. We need various things to be importable in different contexts (e.g., tests) and I've not worked out a uniform pattern for this yet.

@sirosen sirosen merged commit 7252a25 into globus:main Dec 29, 2025
10 of 11 checks passed
@sirosen sirosen deleted the improve-coverage branch December 29, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-news-is-good-news This change does not require a news file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants