expandProfileGroupSelection static method

EnsembleTestSelection expandProfileGroupSelection(
  1. EnsembleTestSelection selection,
  2. Map<String, List<String>> profileGroups
)

Implementation

static EnsembleTestSelection expandProfileGroupSelection(
  EnsembleTestSelection selection,
  Map<String, List<String>> profileGroups,
) {
  if (selection.profiles.isEmpty || profileGroups.isEmpty) return selection;
  final expanded = <String>{};
  for (final profile in selection.profiles) {
    expanded.add(profile);
    final group = profileGroups[profile];
    if (group != null) expanded.addAll(group);
  }
  return EnsembleTestSelection(
    ids: selection.ids,
    features: selection.features,
    profiles: expanded,
    tags: selection.tags,
    paths: selection.paths,
    exactIds: selection.exactIds,
  );
}