You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Code Coverage] Investigate improving code coverage's detection of __salt__ #64696
Currently code coverage is not completely accurate due to our usage of __salt__. It does not know how to map __salt__['function'] to the correct function. This issue is to investigate a solution for coverage to accurately detect the code coverage even with the use of __salt__
I had a thought about this, one that's still been kicking around, but would require a large effort to tweak everything...
AFAICT there's no practical reason a module can't simply do:
from salt.loader import Loader as __salt__
(Or some other similarly worded incantation. Exactly what things are named aren't very relevant)
I do know that the salt loader attempts to (re)load modules quite often. And it's possible that there's /some/ reason why this type of import would end out failing, but if the salt loader is still the one to compile the code and inject the modules into the salt loader, it /should/ work without stumbling on outdated references or anything.
That's the only thing I know about that would be a concern, but YMMV 🤷
Activity
[-][Code Coverage] [/-][+][Code Coverage] Investigate improving code coverage's detectino of __salt__[/+][-][Code Coverage] Investigate improving code coverage's detectino of __salt__[/-][+][Code Coverage] Investigate improving code coverage's detection of __salt__[/+]waynew commentedon Jul 29, 2023
I had a thought about this, one that's still been kicking around, but would require a large effort to tweak everything...
AFAICT there's no practical reason a module can't simply do:
(Or some other similarly worded incantation. Exactly what things are named aren't very relevant)
I do know that the salt loader attempts to (re)load modules quite often. And it's possible that there's /some/ reason why this type of import would end out failing, but if the salt loader is still the one to compile the code and inject the modules into the salt loader, it /should/ work without stumbling on outdated references or anything.
That's the only thing I know about that would be a concern, but YMMV 🤷
dwoz commentedon Oct 23, 2026
Closing — consolidated into #70498. Each item is tracked there as a checkbox so remaining non-per-file test gaps live in one place.