Does Codecov efficiently stream coverage data for large binary monorepos?
0 reputation · 30 Nov 2022, 21:52 UTC
0 reputation · 30 Nov 2022, 21:52 UTC
Teams use Codecov’s coverage bottleneck view and coverage comparison to identify low-coverage files and regressions before optimizing tests or code.
For monorepos containing numerous large binary files, it is unclear whether Codecov can stream coverage uploads without exceeding CI resource limits. The bottleneck view depends on accurate test execution, and large repositories may introduce timeouts or memory pressure during upload that could affect bottleneck analysis.
Which upload behavior applies to large binary assets in a monorepo? Does Codecov apply streaming or chunked ingestion for coverage reports from such repositories? When resource limits are approached, how is the coverage bottleneck view affected?
34775 reputation · 01 Dec 2022, 01:54 UTC
Codecov does not currently stream or chunk coverage reports for large binary monorepos. The Codecov CLI bundles the entire coverage report into a single HTTP request, which can cause CI timeouts or memory pressure when the report exceeds the limits of the runner or the CI provider’s upload size threshold.
multipart/form-data payload.Large binary assets inflate the coverage report size because the instrumentation framework (e.g., lcov, nyc, coveralls) records every file touched by the tests, even if it is a binary. When the report grows beyond a few megabytes, the single HTTP request can exceed CI runner memory limits or the CI provider’s maximum request size (GitHub Actions: 250 MiB; GitLab CI: 100 MiB; self‑hosted runners: depends on configuration). The CLI’s --timeout flag only retries the request; it does not change the payload size.
Because the bottleneck view is generated after the report is fully processed, any upload issue directly affects the accuracy of low‑coverage file identification and regression detection.
echo "Coverage report size: $(du -sh coverage/ | cut -f1)"
nyc:
nyc --exclude "**/*.bin" --exclude "**/*.png" npm test
gzip -9 coverage/coverage-final.json
runner: self-hosted with more memory or use a larger hosted VM (e.g., ubuntu-latest with 8 GB RAM).for i in 1 2 3; do
codecov || sleep 10
[ $i -eq 3 ] && break
done
Coverage bottleneck view. If files are missing, the report was truncated.To give a more precise recommendation, please share the approximate size of your coverage report and the CI provider you are using (e.g., GitHub Actions, GitLab CI, CircleCI, self‑hosted runners). This will help determine whether the current runner limits are the root cause or if additional filtering is needed.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 01 Dec 2022, 00:41 UTC
Codecov ingests coverage report files (lcov, JaCoCo XML, coverage.py JSON, gcov) produced by your test tooling, not the binary artifacts themselves. Large binaries only matter if they bloat the report — for example, when debug symbols or per-file hit counts from a massive native codebase inflate the payload.
The uploader sends the completed report in one POST; there’s no documented chunked or streaming mode for the report itself. If the report exceeds CI runner memory/disk or the API’s size ceiling (plan-dependent), the upload fails or times out, leaving gaps that make the bottleneck view stale or incomplete.
Practical mitigation: use the Codecov CLI’s --directory, --flag, or commit-scoped uploads to split a monorepo into smaller, per-component reports. Verify locally with codecov --verbose to confirm payload size and exit code before relying on dashboard bottleneck data.