Mentorship-backend: Remove tests directory from test coverage

Created on 2 Feb 2021  路  15Comments  路  Source: anitab-org/mentorship-backend

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

qwe

Quality Assurance

Most helpful comment

Yes, it is an issue. Therefore anyone can work on it

All 15 comments

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%
codecov

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%
codecov

You have done something wrong for generating report. It is using venv too

ok I'll try without the venv & let u know

test
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
venv1

@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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PrashanthPuneriya picture PrashanthPuneriya  路  45Comments

faznan3nazer picture faznan3nazer  路  38Comments

anna4j picture anna4j  路  24Comments

paritoshsinghrahar picture paritoshsinghrahar  路  25Comments

PrashanthPuneriya picture PrashanthPuneriya  路  22Comments