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
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.
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
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
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.
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
@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.
Activity
Ethan-DeBandi99 commentedon Jun 13, 2022
Just noting the best way to run
coverate run -m pytest tests/<test_file>.py && coverage report -mstress-tess commentedon Jun 13, 2022
I think this is a great idea! I know
coverage.pyis used byblackfrom the coverage github
it looks like all we need to do is
pip install coverageand we can check our test coverage by runningAnd we can use
coverage reportto get a nicer breakdown of coverage per file and which lines are not coveredhttps://coverage.readthedocs.io/en/6.4.1/
We might also want to try out
codecovwhich is used bypandasandpytestfor their coverage. I'm wary though because it has a pricing page, it says it's free for open source thoughEthan-DeBandi99 commentedon Jun 13, 2022
Also , noting that we can
conda install coverageEthan-DeBandi99 commentedon Jun 14, 2022
We will most likely want to add
.coverageto our.gitignore.Ethan-DeBandi99 commentedon Jun 14, 2022
if we use
coverage htmlwe need to addhtmlcov/to our.gitignorejoshmarshall1 commentedon Jun 14, 2022
We can use
coverage run --source arkouda/ -m pytest -c pytest.inito only monitor coverage in thearkouda/directory. This will prevent thetestsdirectory from being tracked.joshmarshall1 commentedon Jun 14, 2022
When running the report we can run
coverage html --omit arkouda/_version.py,arkouda/__init__.pyand this will exclude_version.pyand__init__.pyfrom the resulting html reportUsing this shows we have 76% coverage across files in the
arkoudadirectory that contain our codeEthan-DeBandi99 commentedon Jun 29, 2022
@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.
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes Bears-R-Us#1509: Research Coverage Tools for Testing
Closes #1509: Research Coverage Tools for Testing (#5035)