Skip to content

[Code Coverage] Investigate improving code coverage's detection of __salt__ #64696

Closed as not planned

Description

@Ch3LL

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__

Activity

  1. added this to the Chlorine v3007.0 milestone on Jul 21, 2023
  2. changed the title [-][Code Coverage] [/-] [+][Code Coverage] Investigate improving code coverage's detectino of __salt__[/+] on Jul 21, 2023
  3. changed the title [-][Code Coverage] Investigate improving code coverage's detectino of __salt__[/-] [+][Code Coverage] Investigate improving code coverage's detection of __salt__[/+] on Jul 21, 2023
  4. waynew commented on Jul 29, 2023

    @waynew
    Contributor

    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 🤷

  5. dwoz commented on Oct 23, 2026

    @dwoz
    Contributor

    Closing — consolidated into #70498. Each item is tracked there as a checkbox so remaining non-per-file test gaps live in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions