From 275dbea1e2b97131323339e63b6a53271e780d43 Mon Sep 17 00:00:00 2001 From: "unicoderbot[bot]" <269805761+unicoderbot[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 08:40:08 +0000 Subject: [PATCH 1/2] feat(mcp): expose show_uncovered on the test tool Closes #1705 Co-authored-by: marcossevilla --- lib/src/mcp/mcp_server.dart | 30 ++++++++++++++++++++++-------- test/src/mcp/mcp_server_test.dart | 12 ++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/lib/src/mcp/mcp_server.dart b/lib/src/mcp/mcp_server.dart index 7b80a8125..be519101a 100644 --- a/lib/src/mcp/mcp_server.dart +++ b/lib/src/mcp/mcp_server.dart @@ -22,9 +22,8 @@ import 'package:very_good_cli/src/version.dart'; /// outside the zone would still write to the real process stdout and corrupt /// the MCP JSON-RPC stream. /// {@endtemplate} -typedef CommandRunnerBuilder = VeryGoodCommandRunner Function({ - required Logger logger, -}); +typedef CommandRunnerBuilder = + VeryGoodCommandRunner Function({required Logger logger}); /// The default [CommandRunnerBuilder] used when none is injected. @visibleForTesting @@ -121,10 +120,12 @@ The organization for this new project. (defaults to "com.example.verygoodcore")''', ), 'output_directory': StringSchema( - description: '''The desired output directory when creating a new project.''', + description: + '''The desired output directory when creating a new project.''', ), 'application_id': StringSchema( - description: '''The bundle identifier on iOS or application id on Android. (defaults to .)''', + description: + '''The bundle identifier on iOS or application id on Android. (defaults to .)''', ), 'platforms': StringSchema( description: ''' @@ -174,7 +175,8 @@ If is omitted, then core will be selected. 'Can be absolute or relative path to project root.', ), 'dart': BooleanSchema( - description: '''Whether to run Dart tests. If not specified, Flutter tests will be run if a Flutter project is detected.''', + description: + '''Whether to run Dart tests. If not specified, Flutter tests will be run if a Flutter project is detected.''', ), 'coverage': BooleanSchema( description: 'Whether to collect coverage information.', @@ -200,7 +202,8 @@ Automatically set to 1 when --platform is specified. '''Run only tests associated with the specified tags.''', ), 'exclude_coverage': StringSchema( - description: '''A glob which will be used to exclude files that match from the coverage (e.g. '**/*.g.dart').''', + description: + '''A glob which will be used to exclude files that match from the coverage (e.g. '**/*.g.dart').''', ), 'exclude_tags': StringSchema( description: @@ -211,7 +214,8 @@ Automatically set to 1 when --platform is specified. '''Whether to enforce a minimum coverage percentage.''', ), 'test_randomize_ordering_seed': StringSchema( - description: '''The seed to randomize the execution order of test cases within test files.''', + description: + '''The seed to randomize the execution order of test cases within test files.''', ), 'update_goldens': BooleanSchema( description: ''' @@ -251,6 +255,13 @@ Only one value can be selected. '(e.g. // coverage:ignore-line). ' 'Only applies to Dart tests (dart: true).', ), + 'show_uncovered': BooleanSchema( + description: + 'Whether to list uncovered lines when coverage is below ' + '100%. Implicitly enables coverage collection when used ' + 'alone. Useful for identifying which lines still need ' + 'tests after a min_coverage failure.', + ), 'timeout_seconds': IntegerSchema( description: 'Maximum seconds to wait for the test run before killing ' @@ -441,6 +452,9 @@ Only one value can be selected. if (args['check_ignore'] == true) { cliArgs.add('--check-ignore'); } + if (args['show_uncovered'] == true) { + cliArgs.add('--show-uncovered'); + } if (args['timeout_seconds'] != null) { cliArgs.addAll([ '--timeout', diff --git a/test/src/mcp/mcp_server_test.dart b/test/src/mcp/mcp_server_test.dart index 6c36ce9a3..91d4f1026 100644 --- a/test/src/mcp/mcp_server_test.dart +++ b/test/src/mcp/mcp_server_test.dart @@ -280,10 +280,7 @@ void main() { final capturedArgs = verify(() => mockCommandRunner.run(captureAny())).captured.first as List; - expect( - capturedArgs, - equals(['create', 'docs_site', 'my_docs']), - ); + expect(capturedArgs, equals(['create', 'docs_site', 'my_docs'])); }); test('handles command runner failure', () async { @@ -388,6 +385,7 @@ void main() { 'platform': 'chrome', 'run_skipped': true, 'check_ignore': true, + 'show_uncovered': true, 'timeout_seconds': 60, }, ), @@ -426,6 +424,7 @@ void main() { 'chrome', '--run-skipped', '--check-ignore', + '--show-uncovered', '--timeout', '60', ]), @@ -490,10 +489,7 @@ void main() { await sendRequest( CallToolRequest.methodName, _params( - CallToolRequest( - name: 'test', - arguments: {'timeout_seconds': 120}, - ), + CallToolRequest(name: 'test', arguments: {'timeout_seconds': 120}), ), ); From 170010eab7fe27a63c4dc49a89f6cba4dfe48802 Mon Sep 17 00:00:00 2001 From: "unicoderbot[bot]" <269805761+unicoderbot[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 08:51:50 +0000 Subject: [PATCH 2/2] fix(ci): address failing checks on PR #1706 (attempt 1/3) --- lib/src/mcp/mcp_server.dart | 20 ++++++++------------ test/src/mcp/mcp_server_test.dart | 10 ++++++++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/src/mcp/mcp_server.dart b/lib/src/mcp/mcp_server.dart index be519101a..d6d97fc4e 100644 --- a/lib/src/mcp/mcp_server.dart +++ b/lib/src/mcp/mcp_server.dart @@ -22,8 +22,9 @@ import 'package:very_good_cli/src/version.dart'; /// outside the zone would still write to the real process stdout and corrupt /// the MCP JSON-RPC stream. /// {@endtemplate} -typedef CommandRunnerBuilder = - VeryGoodCommandRunner Function({required Logger logger}); +typedef CommandRunnerBuilder = VeryGoodCommandRunner Function({ + required Logger logger, +}); /// The default [CommandRunnerBuilder] used when none is injected. @visibleForTesting @@ -120,12 +121,10 @@ The organization for this new project. (defaults to "com.example.verygoodcore")''', ), 'output_directory': StringSchema( - description: - '''The desired output directory when creating a new project.''', + description: '''The desired output directory when creating a new project.''', ), 'application_id': StringSchema( - description: - '''The bundle identifier on iOS or application id on Android. (defaults to .)''', + description: '''The bundle identifier on iOS or application id on Android. (defaults to .)''', ), 'platforms': StringSchema( description: ''' @@ -175,8 +174,7 @@ If is omitted, then core will be selected. 'Can be absolute or relative path to project root.', ), 'dart': BooleanSchema( - description: - '''Whether to run Dart tests. If not specified, Flutter tests will be run if a Flutter project is detected.''', + description: '''Whether to run Dart tests. If not specified, Flutter tests will be run if a Flutter project is detected.''', ), 'coverage': BooleanSchema( description: 'Whether to collect coverage information.', @@ -202,8 +200,7 @@ Automatically set to 1 when --platform is specified. '''Run only tests associated with the specified tags.''', ), 'exclude_coverage': StringSchema( - description: - '''A glob which will be used to exclude files that match from the coverage (e.g. '**/*.g.dart').''', + description: '''A glob which will be used to exclude files that match from the coverage (e.g. '**/*.g.dart').''', ), 'exclude_tags': StringSchema( description: @@ -214,8 +211,7 @@ Automatically set to 1 when --platform is specified. '''Whether to enforce a minimum coverage percentage.''', ), 'test_randomize_ordering_seed': StringSchema( - description: - '''The seed to randomize the execution order of test cases within test files.''', + description: '''The seed to randomize the execution order of test cases within test files.''', ), 'update_goldens': BooleanSchema( description: ''' diff --git a/test/src/mcp/mcp_server_test.dart b/test/src/mcp/mcp_server_test.dart index 91d4f1026..986c1c05f 100644 --- a/test/src/mcp/mcp_server_test.dart +++ b/test/src/mcp/mcp_server_test.dart @@ -280,7 +280,10 @@ void main() { final capturedArgs = verify(() => mockCommandRunner.run(captureAny())).captured.first as List; - expect(capturedArgs, equals(['create', 'docs_site', 'my_docs'])); + expect( + capturedArgs, + equals(['create', 'docs_site', 'my_docs']), + ); }); test('handles command runner failure', () async { @@ -489,7 +492,10 @@ void main() { await sendRequest( CallToolRequest.methodName, _params( - CallToolRequest(name: 'test', arguments: {'timeout_seconds': 120}), + CallToolRequest( + name: 'test', + arguments: {'timeout_seconds': 120}, + ), ), );