Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat(test): keep optimization when targeting specific test files

Đang mở
#1,762 1 bình luận 4 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
dart
Lĩnh vực
cli, testing

Hướng nghiên cứu

Start at the very_good test optimization decision (shouldOptimize and isTargettingTestFiles) and trace how targeted paths are handled; compare the very_good dart test entry point and the pre-gen hook used for sharding. Define behavior for qualifying files and directories, exclusions, and the listed opt-out cases, then verify results are reported per file through resolveReport and coverage remains unchanged. Done means targeted test files are optimized under the stated conditions while existing behavior is preserved for the stated exceptions.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

very_good test turns optimization off whenever a positional path is given (shouldOptimize -> isTargettingTestFiles). Large suites often run a computed subset (tests affected by a change, picked by a project script) in the inner loop or CI. For subsets of tens to hundreds of files every file pays its own compile and VM start, exactly the cost the optimizer removes. Today the choice is the whole suite optimized, or nothing.

Proposal

very_good test test/a_test.dart test/feature/ ... generates .test_optimizer.dart from only the targeted files instead of disabling optimization.

  • A target qualifies if it is an existing *_test.dart file or a directory inside the package's test/; a directory selects every test file under it.
  • Files tagged skip_very_good_optimization or matched by --exclude-optimization still run as their own suites, only if they are in the target set.
  • Anything else (line selectors like foo_test.dart:12, paths outside test/, --platform, --update-goldens) keeps today's behaviour.
  • --no-optimization still turns it off.
  • With --total-shards, the target set is sharded in the pre-gen hook before the round-robin.
  • Same for very_good dart test.

Behaviour

Results are reported per file through the existing resolveReport mapping. Coverage unchanged.

Backwards compatibility

Runs without paths are unchanged. Runs with paths become optimized; suites that only pass unbundled can opt out with --no-optimization, the skip tag or --exclude-optimization. If preferred, gate it behind --optimize-targets / optimization.targets: true in very_good.yaml for one minor release.

Scope

No git or dependency analysis (see #1695): the caller chooses the files, the CLI only bundles them. Happy to send a PR.

Ngôn ngữ chính
Dart
Star
2.4k
Fork
244
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
25

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của VeryGoodOpenSource/very_good_cli

Tất cả issue của VeryGoodOpenSource/very_good_cli

Issue tương tự

Thêm issue về Dart

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.