# The more tests I add, the lower the code coverage

**URL:** <https://community.codecov.com/t/the-more-tests-i-add-the-lower-the-code-coverage/2099>\
**Category:** Support\
**Created:** [October 1, 2020, 7:46am UTC](https://community.codecov.com/t/the-more-tests-i-add-the-lower-the-code-coverage/2099 "2020-10-01T07:46:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaytaph](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/jaytaph/32/1143_2.png) [@jaytaph](https://community.codecov.com/u/jaytaph)\
**Post date:** [October 1, 2020, 7:46am UTC](https://community.codecov.com/t/the-more-tests-i-add-the-lower-the-code-coverage/2099/1 "2020-10-01T07:46:21Z")

</div>

### Description

I’m adding more tests to my codebase, but since a few commits the code coverage keeps getting worse and worse.

### Repository

> **[Code coverage done right.](https://app.codecov.io/gh/bitmaelum/bitmaelum-suite/commit/e9ac482a81082306d75b8946066a7324f350b314)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

### CI/CD

Github Actions

### Uploader

bash uploader

### Commit SHAs

> **[Code coverage done right.](https://app.codecov.io/gh/bitmaelum/bitmaelum-suite/commit/e9ac482a81082306d75b8946066a7324f350b314)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

> **[Code coverage done right.](https://app.codecov.io/gh/bitmaelum/bitmaelum-suite/commit/4930d0f04169d06e6a7b2e028cb3912f129ac3dd)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

### Additional Information

It seems that since a few commits some of the test files are seemed “untracked”. It resulted in a 2% dip of code coverage (while adding more tests)… and the latest commit actually dropped with 8% code coverage (with again, another test added).

I’m sure codecov works as intended, so i’m not reading things right, or doing things not correctly, but i’m not sure what i’m missing here.

---

<div class="post-metadata">

**Author:** ![jaytaph](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/jaytaph/32/1143_2.png) [@jaytaph](https://community.codecov.com/u/jaytaph)\
**Post date:** [October 1, 2020, 8:39am UTC](https://community.codecov.com/t/the-more-tests-i-add-the-lower-the-code-coverage/2099/2 "2020-10-01T08:39:49Z")

</div>

I’m actually thinking that this might have to do with adding new directories. As soon as I add the first test-file in a directory, it will count the whole directory towards the code coverage (i think it skips it when no test files are found inside a dir)… not sure if i’m right though

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [October 5, 2020, 2:09am UTC](https://community.codecov.com/t/the-more-tests-i-add-the-lower-the-code-coverage/2099/3 "2020-10-05T02:09:44Z")

</div>

Hi @jaytaph, I’m not sure I understand. Could you add a screenshot or two of what you are seeing? Right now, when I go to the [commits](https://codecov.io/gh/bitmaelum/bitmaelum-suite/commits) tab, I see coverage going up.

---

<div class="post-metadata">

**Author:** ![jaytaph](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/jaytaph/32/1143_2.png) [@jaytaph](https://community.codecov.com/u/jaytaph)\
**Post date:** [October 5, 2020, 6:31am UTC](https://community.codecov.com/t/the-more-tests-i-add-the-lower-the-code-coverage/2099/4 "2020-10-05T06:31:25Z")

</div>

Yes… it’s increasing again. After some investigation, it turned out to be what I was thinking: when you add a test in a new directory, all files in that directory will be counted so it can indeed decrease the overall in those cases.
