Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#1,762 1 comentario 4 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
dart
Área
cli, testing

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Dart
Estrellas
2.4k
Forks
244
Merge medio
1 d 4 h
PR fusionados (30 d)
25

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de VeryGoodOpenSource/very_good_cli

Todos los issues de VeryGoodOpenSource/very_good_cli

Issues similares

Más issues de Dart

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.