Skip to content

Conversation

@DanTup
Copy link
Member

@DanTup DanTup commented Jan 15, 2026

Fixes #5798

@DanTup DanTup added this to the v3.128.0 milestone Jan 15, 2026
@DanTup DanTup added is enhancement in dart Relates to running Dart programs in testing Relates to test execution of Dart/Flutter tests for end users labels Jan 15, 2026
@DanTup DanTup requested a review from Copilot January 15, 2026 10:05
@DanTup
Copy link
Member Author

DanTup commented Jan 15, 2026

@codex review

/gemini review

@gemini-code-assist
Copy link

Thank you for invoking /gemini review! I've completed my review of your pull request.

It looks like you also included @codex review in your comment. Please note that @codex review is not a valid command for me. If you intended to ask for a code review, /gemini review is the correct command, which I have processed.

Pull Request Review Summary

This pull request effectively extends the --coverage-package functionality to non-Flutter Dart projects, allowing for more comprehensive coverage collection across the entire workspace. The changes are well-implemented and demonstrate a clear understanding of the dart test capabilities.

Key observations:

  • Capability Detection: The introduction of DartTestCapabilities and its supportsCoveragePackage property is a robust way to conditionally enable this feature based on the dart test version. This ensures backward compatibility and proper behavior across different SDK versions.
  • Integration: The dartTestCapabilities object is correctly passed through the relevant functions (TestCommands and getLaunchConfig) to ensure the --coverage-package arguments are only added when supported.
  • Test Coverage: The updates to the test suite are thorough. Unskipping the relevant tests and adding conditional this.skip() based on supportsCoveragePackage ensures that the new functionality is properly tested and that tests don't fail on older SDKs. The correction of package name regex in tests is also a good catch.
  • Dependency Updates: Updating the test package version in the test project pubspec.yaml files to ^1.29.0 is essential for enabling the --coverage-package feature in the test environment.

Overall, the changes are logical, well-structured, and directly address the stated objective of fixing issue #5798. The code is clean and follows good practices for handling feature detection.

No further issues were found during this review.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for passing --coverage-package flags to dart test when the test package version supports it (1.29.0+). This enables collecting coverage from the entire workspace, not just the test file being run, similar to existing Flutter test behavior.

Changes:

  • Updated test package version from 1.27.0 to 1.29.0 in test project pubspec files
  • Added supportsCoveragePackage capability check for dart test package
  • Modified test launch configuration to compute and pass dart test capabilities for non-Flutter projects
  • Enabled previously skipped coverage tests that verify cross-package coverage collection

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/test/test_projects/hello_world/pubspec.yaml Updated test package to version 1.29.0 to support --coverage-package flag
src/test/test_projects/hello_world/example/pubspec.yaml Updated test package to version 1.29.0 to support --coverage-package flag
src/test/helpers.ts Reorganized file exports, added helloWorldExampleSubFolderPrinterFile, improved error message
src/test/flutter_test_debug/debug/flutter_test.test.ts Added dartTestCapabilities parameter to getLaunchConfig call (not used for Flutter)
src/test/dart_debug/dart_test.test.ts Re-enabled coverage tests with capability checks, added imports for new test files
src/shared/utils/test.ts Added dartTestCapabilities parameter and logic to conditionally use --coverage-package for Dart tests
src/shared/capabilities/dart_test.ts Added supportsCoveragePackage capability that checks for version 1.29.0+ or --coverage-package flag
src/extension/commands/test.ts Compute and pass dartTestCapabilities for Dart tests, refactored capability checking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.00%. Comparing base (734b443) to head (a98d0cb).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/shared/capabilities/dart_test.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5875      +/-   ##
==========================================
- Coverage   67.34%   67.00%   -0.34%     
==========================================
  Files         168      168              
  Lines       12891    12894       +3     
  Branches     2553     2554       +1     
==========================================
- Hits         8681     8640      -41     
- Misses       3759     3796      +37     
- Partials      451      458       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DanTup DanTup merged commit b948bb0 into master Jan 15, 2026
20 of 21 checks passed
@DanTup DanTup deleted the dart-coverage-package branch January 15, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in dart Relates to running Dart programs in testing Relates to test execution of Dart/Flutter tests for end users is enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support collecting coverage for other packages in the workspace for Dart, like Flutter has

2 participants