-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
[WIP] add pragma statements #5749
Conversation
…nto test-coverage
…nto test-coverage
add pragma no cover to profile add pragma no cover to utils_test taking another pass at pragma no cover for utils_test excluding obvious cases with pragma statement
adding obvious pragma no cover
Can one of the admins verify this patch? |
Files reviewed in this PR: _concurrent_futures_thread.py-- really not sure about this one! seems a lot is not covered, and I wasn't sure how easy this is to test. node.py-- wasn't sure about objects.py-- didn't see any obvious place to add
|
Unit Test Results 17 files - 1 17 suites - 1 9h 47m 49s ⏱️ - 36m 22s For more details on these failures, see this check. Results for commit 51f26ad. ± Comparison against base commit 91f899e. ♻️ This comment has been updated with latest results. |
Thank you for your effort on this! I would actually recommend opening the other files in another PR, doing this incrementally in batches. That makes reviewing a bit easier and we can merge incrementally to avoid merge conflicts
I think this is a good example for a thing we do not want to ignore. We are clearly entering this function (the
If you are not sure about this, feel free to split it off into a separate PR. In my mind the initial PRs for this should be fast and without a lot of discussion I suggest to not ignore. I don't know how this is tested right now but both lines look like actual functionality which we should be testing imo
They are hit from what I see. If you have reports were they are not hit, this is one of these "flaky" coverage places where it might pay off to have a closer look so I suggest to not ignore |
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.
I agree that we should split off the utils.py
to another PR. I think a lot of these ignores should not be there and this may be an opportunity to clean up our API a little bit
distributed/actor.py
Outdated
@@ -143,7 +143,7 @@ def __getattr__(self, key): | |||
return lambda *args, **kwargs: ActorFuture( | |||
None, self._io_loop, result=attr(*args, **kwargs) | |||
) | |||
else: | |||
else: # pragma: no cover |
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.
getattr is nasty and imo should be properly tested even for trivial cases
else: # pragma: no cover | |
else: |
distributed/cli/dask_scheduler.py
Outdated
@@ -218,4 +218,4 @@ def go(): | |||
|
|||
|
|||
if __name__ == "__main__": | |||
go() |
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.
I'm wondering if the entire CLI module should be ignored. Can we get reliable coverage information from this?
distributed/deploy/adaptive_core.py
Outdated
if TYPE_CHECKING: | ||
from ..scheduler import WorkerState | ||
from ..scheduler import WorkerState # pragma: no cover |
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.
I assume this can be added to
Lines 16 to 25 in 27e467e
exclude_lines = | |
# re-enable the standard pragma | |
pragma: nocover | |
pragma: no cover | |
# exclude nvml calls | |
[\s(.]nvml[\s(.] | |
[\s(.]pynvml[\s(.] | |
# exclude LOG_PDB | |
LOG_PDB | |
such that TYPE_CHECKING
blocks are always ignored
distributed/deploy/spec.py
Outdated
@@ -271,7 +271,7 @@ async def _start(self): | |||
self._lock = asyncio.Lock() | |||
self.status = Status.starting | |||
|
|||
if self.scheduler_spec is None: |
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.
keep this, please. This smells like dead code or something we should be testing
distributed/profile.py
Outdated
@@ -348,7 +348,7 @@ def get_profile(history, recent=None, start=None, stop=None, key=None): | |||
|
|||
if stop is None: | |||
istop = None | |||
else: |
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.
keep this please. Either it should be tested or it shouldn't be there.
distributed/utils_test.py
Outdated
from typing_extensions import Literal | ||
|
||
from distributed.compatibility import MACOS | ||
from distributed.scheduler import Scheduler | ||
|
||
try: | ||
import ssl | ||
except ImportError: |
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.
we could consider adding except ImportError as well to the exclude_lines
Thank you @fjetter for the review! Once I address your comments I'll open up separate PRs for the other files, starting with
Oh interesting, yup in the most recent coverage report I can see they are covered. I won't ignore them, then, and will also see if I can find the report where I saw them marked as not covered. |
…nto improve-coverage
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.
Thank you @scharlottej13 !
WIP, because I haven't made it through all the files yet. Going in order of lowest to highest percent coverage I made it to
utils.py
.cc: @ncclementi @phobson-- thanks again for your help!