# \#code-coverage

**URL:** https://forum.elixirforum.com/tag/code-coverage/780.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [How to ensure 100% code coverage for Ash?](https://forum.elixirforum.com/t/how-to-ensure-100-code-coverage-for-ash/74262)

<div class="topic-metadata">

**Author:** [@nittin](https://forum.elixirforum.com/u/nittin)\
**Replies:** 2\
**Last updated:** [February 10, 2026, 8:03pm UTC](https://forum.elixirforum.com/t/how-to-ensure-100-code-coverage-for-ash/74262 "2026-02-10T20:03:57Z")

</div>

I’m using ExCoveralls to measure code coverage in an Ash-based project, and I noticed that lines written through Ash DSL macros don’t appear as SLOC in the coverage report. For example, in the following action: create …

---

## [Why is defmodule line marked as executable on mix test --cover?](https://forum.elixirforum.com/t/why-is-defmodule-line-marked-as-executable-on-mix-test-cover/59138)

<div class="topic-metadata">

**Author:** [@kelvinst](https://forum.elixirforum.com/u/kelvinst)\
**Replies:** 7\
**Last updated:** [May 9, 2025, 2:43pm UTC](https://forum.elixirforum.com/t/why-is-defmodule-line-marked-as-executable-on-mix-test-cover/59138 "2025-05-09T14:43:21Z")

</div>

When I run mix test --cover in my Phoenix project, I get some files with poor coverage because they are tiny modules with a use Something, and some of them mark the defmodule X do line as executable. e.g. Any idea w…

---

## [Creating a production release with :cover information](https://forum.elixirforum.com/t/creating-a-production-release-with-cover-information/66432)

<div class="topic-metadata">

**Author:** [@gmile](https://forum.elixirforum.com/u/gmile)\
**Replies:** 6\
**Last updated:** [March 7, 2025, 7:23am UTC](https://forum.elixirforum.com/t/creating-a-production-release-with-cover-information/66432 "2025-03-07T07:23:49Z")

</div>

I’d like to run a release with a “cover” information compiled in, run the application for a few days to collect the cover info to identify dead code in a legacy codebase. Optionally, doing so could help see what are the …

---

## [How to converge test coverage when splitting tests with \`--partitions\` and \`MIX\_TEST\_PARTITION\`?](https://forum.elixirforum.com/t/how-to-converge-test-coverage-when-splitting-tests-with-partitions-and-mix-test-partition/67626)

<div class="topic-metadata">

**Author:** [@ppicom](https://forum.elixirforum.com/u/ppicom)\
**Replies:** 3\
**Last updated:** [November 21, 2024, 2:12pm UTC](https://forum.elixirforum.com/t/how-to-converge-test-coverage-when-splitting-tests-with-partitions-and-mix-test-partition/67626 "2024-11-21T14:12:43Z")

</div>

Hello, I attempted to split the test suite of a large Elixir project to improve execution speed. However, I observed that the test coverage percentage dropped, which is expected since each partition only runs a subset o…

---

## [Code Coverage incorrect for function with multiple clauses](https://forum.elixirforum.com/t/code-coverage-incorrect-for-function-with-multiple-clauses/66367)

<div class="topic-metadata">

**Author:** [@numso](https://forum.elixirforum.com/u/numso)\
**Replies:** 2\
**Last updated:** [October 1, 2024, 10:23pm UTC](https://forum.elixirforum.com/t/code-coverage-incorrect-for-function-with-multiple-clauses/66367 "2024-10-01T22:23:19Z")

</div>

Hi all! I noticed something odd while testing one of my LiveViews today. I wrote a test for one of the handle\_event/3 function clauses. Made the test pass. Verified that the assigns were getting set correctly. Then disc…

---

## [Does any one know of a library that will generate an HTML test report?](https://forum.elixirforum.com/t/does-any-one-know-of-a-library-that-will-generate-an-html-test-report/55213)

<div class="topic-metadata">

**Author:** [@hpotdar21](https://forum.elixirforum.com/u/hpotdar21)\
**Replies:** 6\
**Last updated:** [August 21, 2024, 9:36am UTC](https://forum.elixirforum.com/t/does-any-one-know-of-a-library-that-will-generate-an-html-test-report/55213 "2024-08-21T09:36:10Z")

</div>

Is any one knows which library is used for to generate elixir test report which will open in any of browser and shows some of details which will gives the exact clarity about test means how much of pass and failed.

---

## [HEEX template files not included in code coverage](https://forum.elixirforum.com/t/heex-template-files-not-included-in-code-coverage/47572)

<div class="topic-metadata">

**Author:** [@ChristianAlexander](https://forum.elixirforum.com/u/ChristianAlexander)\
**Replies:** 4\
**Last updated:** [March 11, 2024, 6:54am UTC](https://forum.elixirforum.com/t/heex-template-files-not-included-in-code-coverage/47572 "2024-03-11T06:54:31Z")

</div>

Hi there! Is there a way to include heex files in code coverage reporting? It appears that ~H sections within .ex files such as views and components are reported, but when the templates are in .html.heex files, they are…

---

## [Surprising lines missing from coverage results](https://forum.elixirforum.com/t/surprising-lines-missing-from-coverage-results/38571)

<div class="topic-metadata">

**Author:** [@pmonson711](https://forum.elixirforum.com/u/pmonson711)\
**Replies:** 15\
**Last updated:** [November 15, 2023, 11:54pm UTC](https://forum.elixirforum.com/t/surprising-lines-missing-from-coverage-results/38571 "2023-11-15T23:54:49Z")

</div>

Hey Elixir-land! It’s been a while since I’ve been around. Getting back into lots of elixir work and I found something unexpected regarding the coverage system. Essentially function calls wrapped in literals don’t seem …

---

## [Problem Using ExCoveralls When There Are Specs In Code](https://forum.elixirforum.com/t/problem-using-excoveralls-when-there-are-specs-in-code/23162)

<div class="topic-metadata">

**Author:** [@dc0d](https://forum.elixirforum.com/u/dc0d)\
**Replies:** 8\
**Last updated:** [January 12, 2023, 1:56pm UTC](https://forum.elixirforum.com/t/problem-using-excoveralls-when-there-are-specs-in-code/23162 "2023-01-12T13:56:49Z")

</div>

In short, when the specs are removed from lib/excoveralls\_spec\_lab/kata/user.ex , then the command mix coveralls.html works without a problem and generates the output html file cover/excoveralls.html . But if there …

---

## [Code Coverage for Umbrella Projects in GitLab](https://forum.elixirforum.com/t/code-coverage-for-umbrella-projects-in-gitlab/50231)

<div class="topic-metadata">

**Author:** [@ausimian](https://forum.elixirforum.com/u/ausimian)\
**Replies:** 0\
**Last updated:** [September 13, 2022, 12:21am UTC](https://forum.elixirforum.com/t/code-coverage-for-umbrella-projects-in-gitlab/50231 "2022-09-13T00:21:41Z")

</div>

I spent a bit of time looking at getting code-coverage metrics and reporting working for an umbrella project in a self-hosted GitLab instance (15.3). There were a few things I tried along the way and I’m posting it here …

---

## [Mix test --cover excessive logging](https://forum.elixirforum.com/t/mix-test-cover-excessive-logging/48788)

<div class="topic-metadata">

**Author:** [@jfacoustic](https://forum.elixirforum.com/u/jfacoustic)\
**Replies:** 2\
**Last updated:** [July 6, 2022, 5:42pm UTC](https://forum.elixirforum.com/t/mix-test-cover-excessive-logging/48788 "2022-07-06T17:42:20Z")

</div>

Getting really annoying logging when I’m trying to run coverage (without using excoveralls). It looks like it’s related to mocking. Any ideas on how to remove these warnings? All I want to see are the coverage statist…

---

## [Code coverage tools for Elixir?](https://forum.elixirforum.com/t/code-coverage-tools-for-elixir/18102)

<div class="topic-metadata">

**Author:** [@Fl4m3Ph03n1x](https://forum.elixirforum.com/u/Fl4m3Ph03n1x)\
**Replies:** 17\
**Last updated:** [May 30, 2022, 9:56am UTC](https://forum.elixirforum.com/t/code-coverage-tools-for-elixir/18102 "2022-05-30T09:56:20Z")

</div>

Background I have a test suite and I need to know the coverage of the project. I have played around with mix test --cover but I find the native erlang’s coverage analysis tool to be insufficient at best. The native cov…

---

## [LcovEx: lcov file generator for elixir projects](https://forum.elixirforum.com/t/lcovex-lcov-file-generator-for-elixir-projects/32057)

<div class="topic-metadata">

**Author:** [@dariodf](https://forum.elixirforum.com/u/dariodf)\
**Replies:** 3\
**Last updated:** [May 25, 2022, 2:11am UTC](https://forum.elixirforum.com/t/lcovex-lcov-file-generator-for-elixir-projects/32057 "2022-05-25T02:11:30Z")

</div>

After a while I found kinda inconvenient to open and check the coverage default reports every time I change a test, so I looked for some inline alternatives for vscode, and I found the Coverage Gutters extension. To work…

---

## [Ignore top line in Elixir tests](https://forum.elixirforum.com/t/ignore-top-line-in-elixir-tests/46280)

<div class="topic-metadata">

**Author:** [@Isabelladr5](https://forum.elixirforum.com/u/Isabelladr5)\
**Replies:** 9\
**Last updated:** [March 2, 2022, 7:19am UTC](https://forum.elixirforum.com/t/ignore-top-line-in-elixir-tests/46280 "2022-03-02T07:19:31Z")

</div>

I am currently writing tests for my views and my coverage is being hindered due to the top two lines not being covered. I’m assuming its probably because those lines don’t get executed during the run because they’re pre…

---

## [\`mix test --cover\` fails with exit code 3 after upgrading to Elixir 1.13 in umbrella app](https://forum.elixirforum.com/t/mix-test-cover-fails-with-exit-code-3-after-upgrading-to-elixir-1-13-in-umbrella-app/44972)

<div class="topic-metadata">

**Author:** [@mikl](https://forum.elixirforum.com/u/mikl)\
**Replies:** 2\
**Last updated:** [January 2, 2022, 9:37pm UTC](https://forum.elixirforum.com/t/mix-test-cover-fails-with-exit-code-3-after-upgrading-to-elixir-1-13-in-umbrella-app/44972 "2022-01-02T21:37:54Z")

</div>

After upgrading to Elixir 1.13, I’ve noticed my CI pipelines failing without any obvious explanation. The tests are run per-app like this: mix cmd --app myapp mix test --cover and that yields this output: Finished in 0…

---

## [Mix test --cover crashes with a FunctionClauseError](https://forum.elixirforum.com/t/mix-test-cover-crashes-with-a-functionclauseerror/37011)

<div class="topic-metadata">

**Author:** [@cjk](https://forum.elixirforum.com/u/cjk)\
**Replies:** 2\
**Last updated:** [January 22, 2021, 8:10am UTC](https://forum.elixirforum.com/t/mix-test-cover-crashes-with-a-functionclauseerror/37011 "2021-01-22T08:10:10Z")

</div>

Hi, in a project I am maintaining I am working on increasing test coverage. But when I wanted to check the current state of coverage with mix test --cover, I got this error: Cover compiling modules ... \*\* (exit) an exc…

---

## [Trying to understand mix test --cover results](https://forum.elixirforum.com/t/trying-to-understand-mix-test-cover-results/33530)

<div class="topic-metadata">

**Author:** [@bluejay](https://forum.elixirforum.com/u/bluejay)\
**Replies:** 0\
**Last updated:** [August 3, 2020, 10:32pm UTC](https://forum.elixirforum.com/t/trying-to-understand-mix-test-cover-results/33530 "2020-08-03T22:32:58Z")

</div>

I am trying to interpret the ouput from running mix test --cover. The screenshot below is the coverage report for a Phoenix LiveView. What I am wondering is how is the live\_component/3call shows as not covered on line …

---

## [Save my from myself: Code coverage misses lines that return a literal](https://forum.elixirforum.com/t/save-my-from-myself-code-coverage-misses-lines-that-return-a-literal/24931)

<div class="topic-metadata">

**Author:** [@scouten](https://forum.elixirforum.com/u/scouten)\
**Replies:** 8\
**Last updated:** [September 3, 2019, 5:26pm UTC](https://forum.elixirforum.com/t/save-my-from-myself-code-coverage-misses-lines-that-return-a-literal/24931 "2019-09-03T17:26:20Z")

</div>

It’s been discussed a few times that code coverage tools do not see lines where a literal value are not flagged as executable lines. To wit: parroty/excoveralls#146 Functions returning a literal are not seen by code co…

---

## [Coverage tool for running application?](https://forum.elixirforum.com/t/coverage-tool-for-running-application/24570)

<div class="topic-metadata">

**Author:** [@karmajunkie](https://forum.elixirforum.com/u/karmajunkie)\
**Replies:** 2\
**Last updated:** [August 10, 2019, 1:20am UTC](https://forum.elixirforum.com/t/coverage-tool-for-running-application/24570 "2019-08-10T01:20:07Z")

</div>

Is there a way to run coverage reports on a running application instead of through mix test --cover? We’ve got a E2E test suite that I’d like to develop some metrics on and see how much of our Elixir application is getti…

---

## [Excoveralls plugin for jenkins CI?](https://forum.elixirforum.com/t/excoveralls-plugin-for-jenkins-ci/18842)

<div class="topic-metadata">

**Author:** [@Fl4m3Ph03n1x](https://forum.elixirforum.com/u/Fl4m3Ph03n1x)\
**Replies:** 3\
**Last updated:** [December 19, 2018, 12:20pm UTC](https://forum.elixirforum.com/t/excoveralls-plugin-for-jenkins-ci/18842 "2018-12-19T12:20:00Z")

</div>

Background After a lot of hard work we finally got a Jenkins CI pulling code from out GitHub repositories and are now doing Continuous Integration as well as Deployment. We get the code and only deploy it if all the tes…

---

## [Excoveralls library: "Code coverage objectives inhibit quality improvement"](https://forum.elixirforum.com/t/excoveralls-library-code-coverage-objectives-inhibit-quality-improvement/14724)

<div class="topic-metadata">

**Author:** [@StefanHoutzager](https://forum.elixirforum.com/u/StefanHoutzager)\
**Replies:** 19\
**Last updated:** [July 14, 2018, 1:03pm UTC](https://forum.elixirforum.com/t/excoveralls-library-code-coverage-objectives-inhibit-quality-improvement/14724 "2018-07-14T13:03:40Z")

</div>

Looks like this is an actively maintained and valued library (380 stars): GitHub - parroty/excoveralls: Coverage report tool for Elixir with coveralls.io integration. · GitHub I see no disclaimer however about the risc …
