Skip to content

Commit 6fcf211

Browse files
committed
ci: document Erlang cover binary / Codecov 0% badge limitation
The Codecov badge currently shows 0% even though the upload succeeds and the local `mix test --cover` reports the correct ~91% coverage. The root cause: the upload is `cover/lcov.info.coverdata` (Erlang cover binary format produced by `mix test --export-coverage`). The Codecov CLI accepts the upload and reports 'Found 90 network files to report' in its log, but its Erlang cover parser returns 0% line coverage for the binary file in the current CLI release (v11.2.8). The proper fix is to install excoveralls and post its JSON output (`cover/excoveralls.json`) instead, which Codecov parses correctly. That requires adding a new dep + switching the test_coverage tool in mix.exs, which is a bigger change than this CI pass warrants. Documented the workaround in codecov.yml so the next maintainer sees the path forward. The local `mix test --cover` threshold (80%, mix.exs) is still enforced at build time, so this is a cosmetic issue with the badge, not a coverage gap.
1 parent 5eca33d commit 6fcf211

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

codecov.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,27 @@ coverage:
2222
target: 70%
2323
threshold: 5%
2424
changes: off
25+
26+
# Note on Codecov badge accuracy:
27+
#
28+
# The CI uploads cover/lcov.info.coverdata (Erlang cover binary
29+
# produced by `mix test --export-coverage`). Codecov accepts the
30+
# upload and reports `Found 90 network files to report` in its log,
31+
# but the line coverage parsing on Erlang cover binaries is broken
32+
# in current Codecov releases and the badge shows 0%.
33+
#
34+
# For an accurate Codecov badge, install excoveralls:
35+
#
36+
# # mix.exs:
37+
# {:excoveralls, "~> 0.18", only: :test},
38+
# test_coverage: [tool: ExCoveralls],
39+
#
40+
# # .github/workflows/ci.yml, replace the Post coverage step with:
41+
# - name: Run tests with coverage
42+
# run: mix coveralls.json
43+
# - uses: codecov/codecov-action@v5
44+
# with:
45+
# files: cover/excoveralls.json
46+
#
47+
# The local mix test --cover threshold (80%) is still enforced at
48+
# build time, so the badge is a cosmetic issue, not a coverage gap.

0 commit comments

Comments
 (0)