This reverts commit 05d5515732.
This commit is contained in:
@@ -5,13 +5,7 @@
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import 'devices.dart';
|
||||
import 'host_agent.dart';
|
||||
import 'task_result.dart';
|
||||
import 'utils.dart';
|
||||
|
||||
typedef SimulatorFunction = Future<void> Function(String deviceId);
|
||||
@@ -150,54 +144,3 @@ Future<void> removeIOSimulator(String deviceId) async {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> runNativeIosXcodeTests(Device device, String projectDirectory) async {
|
||||
final Map<String, String> environment = Platform.environment;
|
||||
// If not running on CI, inject the Flutter team code signing properties.
|
||||
final String developmentTeam = environment['FLUTTER_XCODE_DEVELOPMENT_TEAM'] ?? 'S8QB4VV633';
|
||||
|
||||
final String resultBundleTemp = Directory.systemTemp.createTempSync('flutter_native_ios_tests_xcresult.').path;
|
||||
final String resultBundlePath = path.join(resultBundleTemp, 'result');
|
||||
final int testResultExit = await exec(
|
||||
'xcodebuild',
|
||||
<String>[
|
||||
'-workspace',
|
||||
'Runner.xcworkspace',
|
||||
'-scheme',
|
||||
'Runner',
|
||||
'-configuration',
|
||||
'Release',
|
||||
'-destination',
|
||||
'id=${device.deviceId}',
|
||||
'-resultBundlePath',
|
||||
resultBundlePath,
|
||||
'test',
|
||||
'COMPILER_INDEX_STORE_ENABLE=NO',
|
||||
'DEVELOPMENT_TEAM=$developmentTeam',
|
||||
],
|
||||
workingDirectory: path.join(projectDirectory, 'ios'),
|
||||
canFail: true,
|
||||
);
|
||||
|
||||
if (testResultExit != 0) {
|
||||
final Directory dumpDirectory = hostAgent.dumpDirectory;
|
||||
if (dumpDirectory != null) {
|
||||
// Zip the test results to the artifacts directory for upload.
|
||||
final String zipPath = path.join(
|
||||
dumpDirectory.path, 'xcode_test_results_-${DateTime.now().toLocal().toIso8601String()}.zip');
|
||||
await exec(
|
||||
'zip',
|
||||
<String>[
|
||||
'-r',
|
||||
'-9',
|
||||
zipPath,
|
||||
'result.xcresult',
|
||||
],
|
||||
workingDirectory: resultBundleTemp,
|
||||
canFail: true, // Best effort to get the logs.
|
||||
);
|
||||
}
|
||||
|
||||
throw TaskResult.failure('Xcode iOS unit tests failed');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user