New Feature: console_output パラメータでコンソール出力モードを制御#30
Merged
Conversation
Introduce ConsoleOutput string-backed enum with DEFAULT, ALL, and UNCOVERED_ONLY cases plus a resolve() factory that handles env var > parameter > default priority. Add ConsoleCoverageRenderer with a static render() method that produces console coverage output supporting the three display modes. Ref #27
Integrate ConsoleOutput enum and ConsoleCoverageRenderer into OpenApiCoverageExtension, replacing inline printReport() and percentage() methods. Parse console_output parameter and pass ConsoleOutput to the subscriber. Refs: #27
Document the console_output parameter and OPENAPI_CONSOLE_OUTPUT environment variable. Add output examples for all three modes (default, all, uncovered_only) and a GitHub Actions CI example. Refs #27
…nderer logic Add stderr warnings when invalid values are provided for the OPENAPI_CONSOLE_OUTPUT env var or console_output phpunit.xml parameter. Remove arithmetic-derived uncoveredCount in favor of count() on the actual uncovered array. Add edge-case tests for zero coverage, full coverage, and percentage rounding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
コンソール出力で未カバーのエンドポイントを個別表示するオプションを追加。大規模 API(300+ エンドポイント)で、ターミナルから直接未カバーのエンドポイントを確認できるようになります。
変更内容
ConsoleOutputenum を新規追加(default/all/uncovered_onlyの3モード)resolve()ファクトリメソッドで環境変数 > phpunit.xml パラメータ > デフォルトの優先順位を処理defaultにフォールバックConsoleCoverageRendererを新規追加(MarkdownCoverageRendererと対称的な設計)echoではなくstringを返すことでテスタブルにdefault: covered 個別リスト + uncovered 件数のみ(既存動作)all: 両方を個別リストuncovered_only: uncovered 個別リスト + covered 件数のみOpenApiCoverageExtensionを修正し、console_outputパラメータのパースとConsoleCoverageRendererへの委譲を実装ConsoleOutputTest: 14テスト、ConsoleCoverageRendererTest: 12テスト)OPENAPI_CONSOLE_OUTPUTの使用方法、GitHub Actions での CI 例を追加関連情報