# Support coverage reports on YAML files

**URL:** <https://community.codecov.com/t/support-coverage-reports-on-yaml-files/2556>\
**Category:** Feature Requests\
**Created:** [February 12, 2021, 2:59pm UTC](https://community.codecov.com/t/support-coverage-reports-on-yaml-files/2556 "2021-02-12T14:59:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdboom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/mdboom/32/1556_2.png) [@mdboom](https://community.codecov.com/u/mdboom)\
**Post date:** [February 12, 2021, 2:59pm UTC](https://community.codecov.com/t/support-coverage-reports-on-yaml-files/2556/1 "2021-02-12T14:59:36Z")

</div>

**Summary**

It is not currently possible to report coverage in a YAML file, because YAML files are explicitly removed by the bash uploader.

**Description**

We are attempting to use a custom coverage reporting tool to file coverage reports for YAML files. We generate code from YAML files and then want to report which of the generated objects are tested in a unit test suite.

Everything works, except YAML files are removed by the codecov-bash uploader.

[This patch to the uploader](https://github.com/mdboom/codecov-bash/commit/b9403f72fce5a48cb884ec9dd0e56c3b97c8b15d) is sufficient to make this work.

**Examples**

To replicate, run a dry-run of the uploader and note that yaml files in the repository are removed from the directory listing.

**Versions**

Current master of codecov-bash

---

<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:** [February 16, 2021, 10:44pm UTC](https://community.codecov.com/t/support-coverage-reports-on-yaml-files/2556/2 "2021-02-16T22:44:15Z")

</div>

@mdboom do you have a repo that runs the patched version of the uploader that shows coverage from Codecov?

---

<div class="post-metadata">

**Author:** ![mdboom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/mdboom/32/1556_2.png) [@mdboom](https://community.codecov.com/u/mdboom)\
**Post date:** [February 17, 2021, 7:44pm UTC](https://community.codecov.com/t/support-coverage-reports-on-yaml-files/2556/3 "2021-02-17T19:44:02Z")

</div>

The support for this hasn’t been merged into our project yet (because we don’t want to use a private fork of the uploader), but a Pull Request is here:

> <https://github.com/mozilla/glean/pull/1482>
>
> Just a playground to see if I can get the pieces working together.
> 
> Depends on… https://github.com/mozilla/glean\_parser/pull/272 for the glean\_parser side of things.
> 
> Example coverage uploaded to codecov.io here: https://codecov.io/gh/mozilla/glean/src/ed8704ac50bcdfcb44ddd3a1fd6004d0eef57675/glean-core/metrics.yaml
> 
> Unfortunately, this requires forking the codecov.io uploader, since it explicitly filters out coverage reporting on \`yaml\` files. (In fairness "coverage" on yaml files is unusual, but seems like it shouldn't be out-and-out disallowed). Anyway, we might have to address that upstream in order for codecov.io to be a viable solution for our users of this feature.
> 
> Other than that, the implementation here turned out much simpler than in the proposal (reminder to go back and update the proposal with where we ended up). By using only a environment variable to turn the feature on (thanks @brizental for the suggestion) and just writing to a file as we go (thanks @chutten for the suggestion), there's no need to hook into the unit testing framework, and thus there's no need for an FFI or language bindings, which makes this all over quite a small change.

And the coverage report that it produces is here:

> **[Code coverage done right.](https://app.codecov.io/gh/mozilla/glean/blob/ed8704ac50bcdfcb44ddd3a1fd6004d0eef57675/glean-core/metrics.yaml)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

---

<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:** [February 18, 2021, 4:36pm UTC](https://community.codecov.com/t/support-coverage-reports-on-yaml-files/2556/4 "2021-02-18T16:36:26Z")

</div>

PR has been opened [here](https://github.com/codecov/codecov-bash/pull/409).

---

<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:** [March 2, 2021, 5:20pm UTC](https://community.codecov.com/t/support-coverage-reports-on-yaml-files/2556/5 "2021-03-02T17:20:05Z")

</div>

@mdboom, you should be able to add `-X yaml` to the bash uploader arguments. Let me know if that works for you!

---

<div class="post-metadata">

**Author:** ![mdboom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/mdboom/32/1556_2.png) [@mdboom](https://community.codecov.com/u/mdboom)\
**Post date:** [March 2, 2021, 5:53pm UTC](https://community.codecov.com/t/support-coverage-reports-on-yaml-files/2556/6 "2021-03-02T17:53:16Z")

</div>

Great, thanks so much, @tom.

It doesn’t look like there has been a production release since this feature was added. Do you know when this will be available at the default URL? (`https://codecov.io/bash`).

---

<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:** [March 2, 2021, 6:15pm UTC](https://community.codecov.com/t/support-coverage-reports-on-yaml-files/2556/7 "2021-03-02T18:15:26Z")

</div>

@mdboom, apologies it was released but not tagged on GitHub. I have tagged it.
