Add code coverage#946
Conversation
|
@francoisfreitag @rbarrois What do you guys think about this? .. Also it would be nice if you create a key over at codecov / equivalent to upload all the files there and not have to download them to see them (PS you will only be able to download the files for a day) :/ |
| - "3.10" | ||
| - "pypy-3.7" | ||
| - "pypy-3.8" | ||
| - ["3.7", "py37"] |
There was a problem hiding this comment.
Adds pretty names.. for the coverage filename. If we move this to codecov / alternative, there would be no need to have this around.
| if: matrix.run-coverage == 'yes' | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: factory_coverage_${{ matrix.python-version[1] }}_${{ matrix.database-type }} |
There was a problem hiding this comment.
Would be nice to move this over to a codecov / equivalent and not have to download it..
| DOC_DIR=docs | ||
| EXAMPLES_DIR=examples | ||
| SETUP_PY=setup.py | ||
| PYTHON_TEST=python \ |
There was a problem hiding this comment.
Moved this here to reuse it for coverage support
| whitelist_externals = make | ||
| commands = make test | ||
| commands = | ||
| !cov: make test |
There was a problem hiding this comment.
Didn't want to force anyone to use nocov, this way its more "intelligent", even though there is a bit of "magic".
|
In the spirit of openness; There is an issue that has alluded me, this only happens sometimes, and only when using pypy{3.7, 3.8} + sqlalchemy + sqlite + coverage. I have been able to reproduce this locally too, but haven't understood the cause. There seems to be little to no information about this issue. It's always the same error in the same place example 3.7 failed Update: Tested it like this (i=0
while (true); do
i=$((i+1))
echo
echo "running tests $i"'!!'
echo
time tox -e pypy37-django32-mongo-alchemy-sqlite-cov
if [ ! "$?" = "0" ]; then
printf '\a\n'
echo "took $i tries"'!!'
break
fi
done)I think i fixed it. It usually failed around 5-10 iterations. I'm by 68 and no crash!! happy dance |
| @rm -rf .coverage htmlcov/ | ||
|
|
||
| coverage-test: | ||
| $(PYTHON_ERROR_ON_WARN) $(COVERAGE_PATH) run -m unittest |
|
There is no point having this around |
When working on the PR "Implements bulk_create for create_batch if available" I found the need to ensure that all the code I wrote was properly tested/covered under tests. Started experimenting and came up with this PR to add coverage when using the CI