buildFlutterTestWorkerEnvironment function
Map<String, String>
buildFlutterTestWorkerEnvironment({
- String? suiteEncryptionKey,
- String? artifactRoot,
- String artifactDisplayRoot = 'build/ensemble_test_runner',
- int? workerIndex,
- String? reportMode,
- int? timeoutSeconds,
- required List<
String> shardPaths, - required List<
String> shardIds, - required String? reportFile,
- required String? progressFile,
- required String? appLogPath,
- required String? appLogDisplayPath,
- required Map<
String, dynamic> ? serviceOverrides, - required List<
String> arguments,
Implementation
Map<String, String> buildFlutterTestWorkerEnvironment({
String? suiteEncryptionKey,
String? artifactRoot,
String artifactDisplayRoot = 'build/ensemble_test_runner',
int? workerIndex,
String? reportMode,
int? timeoutSeconds,
required List<String> shardPaths,
required List<String> shardIds,
required String? reportFile,
required String? progressFile,
required String? appLogPath,
required String? appLogDisplayPath,
required Map<String, dynamic>? serviceOverrides,
required List<String> arguments,
}) {
final planBatchFile = planBatchFileFromArguments(arguments);
return {
'ENSEMBLE_TEST_RUNNER_CONFIG': json.encode({
if (suiteEncryptionKey != null)
'ensembleTestEncryptionKey': suiteEncryptionKey,
if (artifactRoot != null) 'ensembleTestArtifactRoot': artifactRoot,
'ensembleTestArtifactDisplayRoot': artifactDisplayRoot,
if (workerIndex != null) 'ensembleTestWorkerIndex': workerIndex,
if (workerIndex != null)
'ensembleTestWorkerSuffix': 'worker${workerIndex + 1}',
'ensembleTestShardPath': shardPaths,
'ensembleTestShardId': shardIds,
if (reportFile != null) 'ensembleTestReportFile': reportFile,
if (reportMode != null) 'ensembleTestReport': reportMode,
if (timeoutSeconds != null) 'ensembleTestTimeoutSeconds': timeoutSeconds,
if (progressFile != null) 'ensembleTestProgressFile': progressFile,
if (appLogPath != null) 'ensembleTestAppLogFile': appLogPath,
if (appLogDisplayPath != null)
'ensembleTestAppLogDisplayFile': appLogDisplayPath,
if (serviceOverrides != null && serviceOverrides.isNotEmpty)
'ensembleTestServiceOverrides': json.encode(serviceOverrides),
for (final selection in const [
'id',
'feature',
'profile',
'tag',
'path',
'device',
])
if (_optionValues(arguments, '--$selection').isNotEmpty)
'ensembleTest${selection[0].toUpperCase()}${selection.substring(1)}':
_optionValues(arguments, '--$selection'),
if (_inputValues(arguments).isNotEmpty)
'ensembleTestInputs': json.encode(_inputValues(arguments)),
if (planBatchFile != null) 'ensembleTestPlanBatchFile': planBatchFile,
}),
};
}