Describe the bug
At present, each directory and file is included in code coverage but tests directory should not be included there
https://github.com/anitab-org/mentorship-backend/blob/8f1906eb284cc7774cc7325a4fa519afa8a45f2a/.github/workflows/main.yml#L34
Expected behavior
Test directory should be excluded from the coverage
Screenshots

Hey @devkapilbansal Can I take this up?
Also could you just let me know why the test directory should be excluded from the coverage?
Hi, @ashwinijha6 coverage is only calculated for the source code. Here all directories are included in report and hence sometimes gives wrong result when calculating coverage for the whole project.
ok I got your point @devkapilbansal
I assume you don't want to work on this because you didn't mention it @devkapilbansal :)
Will assign to @ashwinijha6
Yes, it is an issue. Therefore anyone can work on it
@devkapilbansal I think the code coverage is not being calculated for the tests directory because when I run coverage report in the mentorship-backend directory it does not show me taking the tests directory into consideration but only app config & run
& then my venv files for which I got a total of 34%
Could u pls check with this also just let me know do u want to exclude the test directory from codecov ui then I'll have to make changes in codecov.yml
@devkapilbansal I think the code coverage is not being calculated for the tests directory because when I run coverage report in the mentorship-backend directory it does not show me taking the tests directory into consideration but only app config & run
& then my venv files for which I got a total of 34%
You have done something wrong for generating report. It is using venv too
ok I'll try without the venv & let u know
I got the correct coverage report I don't know how it was taking in the venv before
@ashwinijha6 any updates?
@ashwinijha6 any updates?
Yes @vj-codes I'm working on it will try to make a pull request by tmr
@devkapilbansal I have created a .coveragerc which omits the test/* & on running the coverage report I get 41% (as shown in the screenshot) but it takes in the virtual environment as well
@ashwinijha6 create your virtualenv outside this directory. Go out of root directory and create virtualenv. Then cd in the directory and test the coverage.Also, you can omit venv/* too if you want
@devkapilbansal & @isabelcosta , could u'll pls review my pull request
Most helpful comment
Yes, it is an issue. Therefore anyone can work on it