Pass --local-engine* flags from dev/bots/test.dart down to pub test via env variables (#71721)

This commit is contained in:
Martin Kustermann
2020-12-04 18:33:04 +01:00
committed by GitHub
parent d375a83910
commit 4300226a50

View File

@@ -56,6 +56,8 @@ final String flutterTester = path.join(flutterRoot, 'bin', 'cache', 'artifacts',
/// configuration) -- prefilled with the arguments passed to test.dart.
final List<String> flutterTestArgs = <String>[];
final Map<String, String> localEngineEnv = <String, String>{};
final bool useFlutterTestFormatter = Platform.environment['FLUTTER_TEST_FORMATTER'] == 'true';
@@ -105,6 +107,13 @@ Future<void> main(List<String> args) async {
print('$clock STARTING ANALYSIS');
try {
flutterTestArgs.addAll(args);
for (final String arg in args) {
if (arg.startsWith('--local-engine='))
localEngineEnv['FLUTTER_LOCAL_ENGINE'] = arg.substring('--local-engine='.length);
if (arg.startsWith('--local-engine-src-path='))
localEngineEnv['FLUTTER_LOCAL_ENGINE_SRC_PATH'] = arg.substring('--local-engine-src-path='.length);
}
if (Platform.environment.containsKey(CIRRUS_TASK_NAME))
print('Running task: ${Platform.environment[CIRRUS_TASK_NAME]}');
print('═' * 80);
@@ -1242,6 +1251,7 @@ Future<void> _pubRunTest(String workingDirectory, {
];
final Map<String, String> pubEnvironment = <String, String>{
'FLUTTER_ROOT': flutterRoot,
...localEngineEnv
};
if (Directory(pubCache).existsSync()) {
pubEnvironment['PUB_CACHE'] = pubCache;