Skip to content

Research Coverage Tools for Testing #1509

Closed

Description

@Ethan-DeBandi99

There have been instances of functionality breaking and not being caught by testing because no testing exists for the feature.

coverage.py has been recommended as an option for verifying that a minimum percentage of our code is tested. This is standard practice to ensure that testing is hitting the majority of code.

We need to look into the configuration and options available for coverage.py. Also, look into adding this to the CI to ensure new functionality is tested.

Activity

  1. added
    enhancement
    on Jun 13, 2022
  2. Ethan-DeBandi99 commented on Jun 13, 2022

    @Ethan-DeBandi99
    ContributorAuthor

    Just noting the best way to run

    coverate run -m pytest tests/<test_file>.py && coverage report -m

  3. stress-tess commented on Jun 13, 2022

    @stress-tess
    Member

    I think this is a great idea! I know coverage.py is used by black

    from the coverage github

    It uses the code analysis tools and tracing hooks provided in the Python standard library to determine which lines are executable, and which have been executed

    it looks like all we need to do is pip install coverage and we can check our test coverage by running

    coverage run -m pytest  -c pytest.ini
    

    And we can use coverage report to get a nicer breakdown of coverage per file and which lines are not covered
    https://coverage.readthedocs.io/en/6.4.1/

    We might also want to try out codecov which is used by pandas and pytest for their coverage. I'm wary though because it has a pricing page, it says it's free for open source though

  4. Ethan-DeBandi99 commented on Jun 13, 2022

    @Ethan-DeBandi99
    ContributorAuthor

    Also , noting that we can conda install coverage

  5. Ethan-DeBandi99 commented on Jun 14, 2022

    @Ethan-DeBandi99
    ContributorAuthor

    We will most likely want to add .coverage to our .gitignore.

  6. Ethan-DeBandi99 commented on Jun 14, 2022

    @Ethan-DeBandi99
    ContributorAuthor

    if we use coverage html we need to add htmlcov/ to our .gitignore

  7. joshmarshall1 commented on Jun 14, 2022

    @joshmarshall1
    Contributor

    We can use coverage run --source arkouda/ -m pytest -c pytest.ini to only monitor coverage in the arkouda/ directory. This will prevent the tests directory from being tracked.

  8. joshmarshall1 commented on Jun 14, 2022

    @joshmarshall1
    Contributor

    When running the report we can run coverage html --omit arkouda/_version.py,arkouda/__init__.py and this will exclude _version.py and __init__.py from the resulting html report

    Using this shows we have 76% coverage across files in the arkouda directory that contain our code

  9. Ethan-DeBandi99 commented on Jun 29, 2022

    @Ethan-DeBandi99
    ContributorAuthor

    @pierce314159, @joshmarshall1 , and I discussed this a bit more yesterday. The main issue that we are seeing is that it does not actually solve our main issue. Ensuring code that can be run on multiple types is tested against all types. While it is important to validate that all of our code is being tested, we really need to go one step further and be able to validate that sections of code running against multiple types are tested against each type.

  10. removed their assignment
    on Nov 29, 2022
  11. self-assigned this
    on Oct 31, 2025
  12. added 3 commits that reference this issue on Oct 31, 2025
    618c594
    57f6cfd
    068e07e
  13. added 3 commits that reference this issue on Nov 12, 2025
    b9bef61
    9a7e5d3
    6c18945
  14. added 3 commits that reference this issue on Nov 20, 2025
    18d2039
    a155d0c
    2df6137
  15. added 5 commits that reference this issue on Dec 3, 2025
    41c3045
    cfe163d
    a3f602c
    cc5ca53
    3f662ea
  16. added a commit that references this issue on Jan 7, 2026
    9d5b842
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions