# Code Coverage for System Tests

**URL:** <https://discuss.elastic.co/t/code-coverage-for-system-tests/66233>\
**Category:** Beats\
**Created:** [November 16, 2016, 9:46am UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233 "2016-11-16T09:46:54Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 6, 2016, 8:53am UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/21 "2016-12-06T08:53:59Z")

</div>

Not sure if the line was not covered, because if it was not covered it should be red. Do you get a "counter" when you hover over the line?

For the details on how the overall coverage is exactly calculated, best have a look at the source code of the coverage generation tool code. I remember we had on Github some discussions about this about a year ago related to codecov as they did the calculation in a different way but I couldn't find it anymore ☹ I never digged into the details of the exact calculation as there are many different ways on doing it and for us the coverage is more an indicator value and it does not matter too much if it is 72.2 or 73.4.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 6, 2016, 8:54am UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/22 "2016-12-06T08:54:29Z")

</div>

Ah, found the github issue: [https://github.com/elastic/beats/pull/723](https://github.com/elastic/beats/pull/723)

---

<div class="post-metadata">

**Author:** ![imharishd](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@imharishd](https://discuss.elastic.co/u/imharishd)\
**Post date:** [December 6, 2016, 9:10am UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/23 "2016-12-06T09:10:38Z")

</div>

Thank you for the immediate response. Also, i don't see an overall coverage for the entire module. I just see the coverage individual directories. However, in the blog i saw the image where they had given the overall coverage for their tests. Am i missing something here ? How to see the overall coverage ?

---

<div class="post-metadata">

**Author:** ![imharishd](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@imharishd](https://discuss.elastic.co/u/imharishd)\
**Post date:** [December 6, 2016, 9:13am UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/24 "2016-12-06T09:13:04Z")

</div>

And yes i do get the counter when i hover over the line.

---

<div class="post-metadata">

**Author:** ![imharishd](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@imharishd](https://discuss.elastic.co/u/imharishd)\
**Post date:** [December 6, 2016, 1:14pm UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/25 "2016-12-06T13:14:11Z")

</div>

Also, when i try to merge multiple coverage file into one file it's consuming lot of space and in some cases the machines runs out of space in the middle of conversion and the operation aborts. Has anyone encountered this ? If yes, kindly provide your solution.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 6, 2016, 4:03pm UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/26 "2016-12-06T16:03:16Z")

</div>

For the overall coverage there comes from codecov: [https://codecov.io/](https://codecov.io/) But we have also an internal python script to do the magic (see comment andrew).

What is a large file for you? For how long do you run your application with the coverage enabled?

---

<div class="post-metadata">

**Author:** ![imharishd](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@imharishd](https://discuss.elastic.co/u/imharishd)\
**Post date:** [December 7, 2016, 3:39am UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/27 "2016-12-07T03:39:14Z")

</div>

The tests run for about 6-7 hours.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 7, 2016, 9:47am UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/28 "2016-12-07T09:47:28Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 7, 2016, 11:36am UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/29 "2016-12-07T11:36:15Z")

</div>



---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 7, 2016, 11:36am UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/30 "2016-12-07T11:36:46Z")

</div>

Ok, I can see why your files get really large. Our tests take between 1 and 60 seconds. What is the file sizes you get?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 9:50pm UTC](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233/31 "2017-07-05T21:50:11Z")

</div>



[Previous page](https://discuss.elastic.co/t/code-coverage-for-system-tests/66233.md?page=1)
