feat: merge lcov reports from sharded test runs
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- dart
- 領域
- cli, testing-qa
調査の方向性
Start in lib/src/cli/test_cli_runner.dart, reading CoverageMetrics.fromLcovRecords and MinCoverageNotMet to understand the existing coverage parsing and reporting flow. Review the sharding behavior from #1707 and the requirements for combining records, path handling, configuration, and output. Done means a command merges multiple lcov files, applies the existing coverage checks and very_good.yaml fallback, writes the result, and includes the requested documentation and CI updates.
索引モデルが issue の本文から書いたものです。
説明
Description
#1707 adds --shard-index and --total-shards to very_good test and very_good dart test, so a suite can be split across CI runners with a strategy.matrix. Sharding and --min-coverage don't mix well yet. Each shard runs only part of the suite, so its coverage/lcov.info reflects only the code that slice touches. With --collect-coverage-from all, _enhanceLcovWithUntestedFiles also adds every file the shard never loaded at 0%. A shard's percentage is always well below the real number, and a threshold check on it fails healthy builds.
#1707 handles this by rejecting an explicit --min-coverage when sharding. The error tells users to collect coverage per shard with --coverage, merge the lcov reports, and enforce the threshold once in a separate job. The CLI has no way to do those last two steps today, so teams have to reach for lcov or a custom script. A threshold set in very_good.yaml is also ignored silently when sharding, so teams that rely on it lose enforcement without being told.
This issue proposes that the CLI merge the shard reports and run the coverage checks on the merged result.
A possible shape:
jobs:
test:
strategy:
matrix:
shard: [1, 2, 3]
steps:
- run: very_good test --coverage --shard-index ${{ matrix.shard }} --total-shards 3
- uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.shard }}
path: coverage/lcov.info
coverage:
needs: test
steps:
- uses: actions/download-artifact@v4
- run: very_good test coverage merge coverage-*/lcov.info --min-coverage 100
The command name and placement are open for discussion. It could live under very_good test or as a new top-level command.
Things the merge has to get right:
- Union hits, don't average percentages. A line counts as covered when any shard hit it. For each source file, sum the per-line hit counts across reports and recompute totals from the merged lines.
- 0% records from
--collect-coverage-from allmust merge cleanly. A file one shard added at 0% and another shard actually covered should end up covered. - Path consistency. Reports from different runners have to agree on each file's path. If
SF:entries can be absolute and runners check out to different directories, paths need normalizing relative to the project root. - Reuse the existing checks.
--min-coverage,--exclude-coverageand--show-uncoveredshould behave exactly as they do in a normal run.CoverageMetrics.fromLcovRecordsandMinCoverageNotMetinlib/src/cli/test_cli_runner.dartalready do the parsing and reporting, so the merge only needs to feed them a combined set of records. - Fall back to
very_good.yaml. The merge step should pick up the threshold fromvery_good.yamlthe same wayvery_good testdoes, which closes the silent-skip gap for sharded runs. - Write the merged report to disk so it can still go to Codecov or be rendered with
genhtml.
#804 asked for something close to this for multi-package apps run with -r, where each package writes its own lcov file. It was closed without a merge feature. The same merge logic would serve both cases, so it's worth designing with both in mind.
Requirements
- A command merges two or more lcov files into a single report.
- Hit counts are combined per file and per line, so a line covered in any input counts as covered.
-
--min-coverage,--exclude-coverageand--show-uncoveredwork on the merged report and match the output of a normalvery_good testrun. - The minimum coverage threshold falls back to
very_good.yamlwhen the flag is not passed. - The merged report is written to a configurable output path.
- The
--min-coverageusage error added in #1707 points to the new command. - Docs describe the sharded CI workflow from start to finish.
- All CI/CD checks are passing.
- There is no drop in the test coverage percentage.
Additional Context
- #1707: sharding PR that rejects
--min-coverageand suggests merging reports - #1538: original sharding request
- #804: earlier request for a single coverage report across multi-package runs
- 主要言語
- Dart
- スター
- 2.4k
- フォーク
- 244
- 平均マージ
- 21時間 32分
- マージ済み PR(30日)
- 33
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
VeryGoodOpenSource/very_good_cli のほかの issue
-
feature
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
VeryGoodOpenSource/very_good_cli#1695 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
feat(mcp): stream progress notifications for long-running tools再び着手できるかも @vgvbot が 50 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンfeature
VeryGoodOpenSource/very_good_cli#1616 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
feature
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
VeryGoodOpenSource/very_good_cli#1363 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[CI - test_optimizer] GitHub Actions, Melos, very_good test lead sometimes to cache error再び着手できるかも @erickzanardo が 344 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug p1
VeryGoodOpenSource/very_good_cli#947 · コメント 13 件 · リアクション 15 件 · 担当者 3 名 ·
メンテナーはふだん 1 日以内に返信
-
feature p2
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
VeryGoodOpenSource/very_good_cli#682 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
VeryGoodOpenSource/very_good_cli の issue をすべて見る
似ている issue
-
Smart charging: USB charger re-assert is starved during BLE scans, so the tablet never dischargesオープンbug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
decentespresso/decaid#931 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
flame-engine/flame#4067 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mrgnhnt96/zonai#37 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
google/skills_lint.dart#58 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nvim-flutter/flutter-tools.nvim#557 ·
メンテナーはふだん 1 日以内に返信