Home›Industry & Policy›コードカバレッジのアップロードで無効なレポート形式を検出するようになりました

コードカバレッジのアップロードで無効なレポート形式を検出するようになりましたCode coverage uploads now flag invalid report formats

元記事を読むRead original articleblog.github.com(新しいタブで開きます)(opens in a new tab)
AI 要約AI summary

GitHub Code Qualityのupload-code-coverageアクションが、Cobertura XML形式でないレポートを検出し、アップロード手順を失敗させるようになりました。以前は成功に見えてもPRに反映されなかった問題に、早く気づけます。

GitHub Code Quality's upload-code-coverage action now fails the step when a report isn't Cobertura XML, instead of silently succeeding. Teams learn of format problems in the workflow log rather than from missing PR coverage.

AI 生成の要約と解説(解説は要約と収集メタデータに基づく)で、元記事全文の転載・翻訳ではありません。日本語版と英語版は言語ごとに独立して生成しています。正確性は元記事 (blog.github.com) でご確認ください。AI-generated summary and explainer (the latter based on the summaries and collected metadata), not a copy or translation of the full source article. Generated independently for each language. Verify accuracy at the original source (blog.github.com).

GitHub Code Qualityのupload-code-coverageアクションが、カバレッジレポートがCobertura XML形式かどうかを検査するようになりました。対応していない形式ならアップロード手順が失敗するため、形式の問題をワークフローの実行時点で把握できます。

形式チェックの追加

対応していない形式のレポートが渡されると、アップロードのステップは失敗します。Actionsのログには次のエラーが表示されます。

「This file is not a Cobertura XML report. Upload a Cobertura XML report.」

これまでは、こうしたアップロードも成功したように見えていました。しかし実際にはプルリクエストにカバレッジが表示されない状態になっていました。今回の変更により、問題はワークフローの実行結果から、次に取るべき手順とあわせて分かるようになったと説明されています。

失敗したときの対処

ワークフローがこのエラーで失敗するようになった場合の対処は、二通り示されています。ひとつは、テストフレームワークがCobertura XMLを出力するよう設定することです。もうひとつは、アップロードのステップより前に、レポートをCobertura XMLへ変換することです。

有効なレポートへの寛容さ

今回の更新では、有効なCobertura形式のレポートの処理も、より寛容になっています。軽微な構造上の問題を理由にレポートを拒否することはなくなりました。

また、使える行番号やヒット数を持たない行があっても、その行だけがスキップされます。以前のようにレポート全体が破棄されることはありません。

形式が違うレポートは明示的に失敗させ、形式が正しいレポートは細かな不備があっても取り込む、という方針の変更です。

Cobertura XML format check

The GitHub Code Quality upload-code-coverage action now verifies that a coverage report is in Cobertura XML format before accepting it. This matters because a wrongly formatted report used to go unnoticed until coverage failed to appear where teams expected it.

If the report is not in a supported format, the upload step fails. The Actions log then shows this error: "This file is not a Cobertura XML report. Upload a Cobertura XML report."

What changes in the workflow

Previously, uploads with an unsupported format appeared to succeed, but no coverage showed up on pull requests. According to the announcement, teams now find out about the problem in the workflow run itself, with a clear next step, instead of discovering missing coverage on their pull requests.

A workflow that starts failing with this error needs one of two fixes, as the announcement describes. One option is to configure the test framework to output Cobertura XML. The other is to convert the existing report to Cobertura XML before the upload step runs.

More forgiving processing

The announcement also says processing is now more tolerant of valid Cobertura reports. A report is no longer rejected because of minor structural issues. In addition, when individual lines lack a usable line number or hit count, those lines are skipped rather than causing the whole report to be discarded.

Taken together, the two changes work in opposite directions. Reports that are not Cobertura XML at all now fail loudly at the upload step. Reports that are valid Cobertura but contain small flaws are more likely to be processed, with only the problematic lines left out.

Practical takeaway

For teams already using the action, the main thing to watch is whether a workflow begins to fail with the new error message. That failure indicates the report format is the cause, and the remedy is to produce or convert to Cobertura XML. Teams whose reports were already valid Cobertura should not need to change anything, and they may see fewer rejections caused by minor structural problems or lines with unusable data.

ポコとTECHガイドPoko & TECH Guide

ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.

  1. ポコPokoカバレッジをアップロードする普段の流れで、何が変わるの?When I upload coverage in my usual workflow, what actually changes?
  2. TECHガイドTECH GuideCobertura XML形式でないレポートだと、アップロードの手順が失敗して、Actionsのログにエラーが出るようになったよ。If the report isn't Cobertura XML, the upload step now fails and the Actions log shows an error.
  3. ポコPoko前は失敗しなかったの? 何か困ることがあったのかな。So it didn't fail before? Was that causing trouble?
  4. TECHガイドTECH Guide前は成功に見えたのに、PRにカバレッジが出なかったそうだよ。今は実行中にエラーで気づけて、対処の道筋も分かるんだ。Before, uploads looked successful but no coverage showed on PRs. Now you find out during the run, with a clear next step.
  5. ポコPokoじゃあ一番の収穫は、静かな失敗がなくなって、すぐ気づけることだね。So the big win is no more silent failures. You spot problems right away.
  6. TECHガイドTECH Guideそうだね。エラーが出たら、テストの出力をCobertura XMLにするか、アップロード前に変換するのがこの記事の案内だよ。Right. If the error appears, the article says to output Cobertura XML from your test framework or convert the report before uploading.
記事情報・収集記録Article details & collection record
出典Source
GitHub Changelog公式Official
公開日時 (JST)Published (JST)
収集日時 (JST)Collected (JST)
配信形式Format
変更履歴Changelog
原文言語Source language
英語English
重要度の位置づけImportance in this lane
MediumMedium priority(Industry & Policy 476件中、同等以上 425件)(425 of 476 Industry & Policy entries are equal or higher)
出典の平均重要度(掲載直近 30 件・最大 30 件)Source average (last 30 listed, up to 30)
2.0 / 31=情報 · 2=中 · 3=高1=Info · 2=Medium · 3=High
情報の寿命Half-life
短命 (ニュース)Short-lived (news)

📰Industry & Policy の他の記事More from Industry & Policyもっと見る →View more →

ページ上部へScroll to top