@@ -11,6 +11,7 @@ import 'package:args/args.dart';
1111import 'package:path/path.dart' as path;
1212
1313import 'configuration.dart' ;
14+ import 'deflake_info.dart' ;
1415import 'path.dart' ;
1516import 'repository.dart' ;
1617import 'test_configurations.dart' ;
@@ -626,12 +627,16 @@ has been specified on the command line.''')
626627
627628 void addConfiguration (Configuration innerConfiguration,
628629 [String ? namedConfiguration]) {
630+ final (testList, deflakeInfoMap) =
631+ parseTestList (data["test-list-contents" ] as List <String >? );
632+
629633 var configuration = TestConfiguration (
630634 configuration: innerConfiguration,
631635 progress: progress,
632- selectors: _expandSelectors (data),
636+ selectors: _expandSelectors (data, testList ),
633637 build: data["build" ] as bool ,
634- testList: data["test-list-contents" ] as List <String >? ,
638+ testList: testList,
639+ deflakeInfoMap: deflakeInfoMap ?? const {},
635640 repeat: int .parse (data["repeat" ] as String ),
636641 batch: ! (data["no-batch" ] as bool ),
637642 copyCoreDumps: data["copy-coredumps" ] as bool ,
@@ -812,18 +817,15 @@ has been specified on the command line.''')
812817 ///
813818 /// If no selectors are explicitly given, uses the default suite patterns.
814819 Map <String , RegExp > _expandSelectors (
815- Map <String , dynamic > configuration) {
820+ Map <String , dynamic > configuration, List < String > ? testList ) {
816821 var selectors = configuration['selectors' ] as List <String >? ?? [];
817822
818823 if (selectors.isEmpty || configuration['default-suites' ] as bool ) {
819824 if (configuration['suite-dir' ] != null ) {
820825 var suitePath = Path (configuration['suite-dir' ] as String );
821826 selectors.add (suitePath.filename);
822- } else if (configuration['test-list-contents' ] != null ) {
823- selectors = (configuration['test-list-contents' ] as List <String >)
824- .map ((t) => t.split ('/' ).first)
825- .toSet ()
826- .toList ();
827+ } else if (testList != null ) {
828+ selectors = testList.map ((t) => t.split ('/' ).first).toSet ().toList ();
827829 } else {
828830 selectors.addAll (_defaultTestSelectors);
829831 }
@@ -1009,3 +1011,16 @@ final Map<String, String> sanitizerEnvironmentVariables = (() {
10091011
10101012 return environment;
10111013})();
1014+
1015+ (List <String >? , Map <String , DeflakeInfo >? ) parseTestList (List <String >? raw) {
1016+ final isJson = raw != null && raw.isNotEmpty && raw[0 ].startsWith ('{' );
1017+ if (! isJson) return (raw, null );
1018+ final deflakes = < DeflakeInfo > [
1019+ for (var line in raw)
1020+ DeflakeInfo .fromJson (jsonDecode (line) as Map <dynamic , dynamic >),
1021+ ];
1022+ return (
1023+ [for (var i in deflakes) i.name],
1024+ {for (var i in deflakes) i.name: i},
1025+ );
1026+ }
0 commit comments