loadTestConfig static method

Future<EnsembleTestConfig> loadTestConfig(
  1. String testsAssetPrefix
)

Implementation

static Future<EnsembleTestConfig> loadTestConfig(
  String testsAssetPrefix,
) async {
  return await RunnerBenchmark.async('discovery', 'loadTestConfig', () async {
    final path = await findConfigAsset(testsAssetPrefix);
    if (path == null) return const EnsembleTestConfig();
    final content = await rootBundle.loadString(path);
    final config = EnsembleTestParser.parseConfigString(
      content,
      sourcePath: path,
    );
    final overridden = _withServiceOverrides(config);
    final withIsolation = overridden ?? _withWorkerIsolation(config);
    final selectedIds = _deviceIdsFromEnvironment();
    if (_executionModeFromEnvironment() == ExecutionMode.integration) {
      return matrix
          .resolveIntegrationDeviceMatrix(
            withIsolation,
            platform: _physicalPlatformFromEnvironment(),
            selectedIds: selectedIds,
          )
          .config;
    }
    return matrix.applyDeviceFilter(withIsolation, selectedIds);
  });
}