Run native_ui_tests_macos in correct directory (#90829)
This commit is contained in:
@@ -140,7 +140,7 @@ Future<void> removeIOSimulator(String deviceId) async {
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> runXcodeTests(String projectDirectory, String deviceId, String testName) async {
|
||||
Future<bool> runXcodeTests(String platformDirectory, String destination, String testName) 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';
|
||||
@@ -159,7 +159,7 @@ Future<bool> runXcodeTests(String projectDirectory, String deviceId, String test
|
||||
'-configuration',
|
||||
'Release',
|
||||
'-destination',
|
||||
'id=$deviceId',
|
||||
destination,
|
||||
'-resultBundlePath',
|
||||
resultBundlePath,
|
||||
'test',
|
||||
@@ -170,27 +170,32 @@ Future<bool> runXcodeTests(String projectDirectory, String deviceId, String test
|
||||
if (provisioningProfile != null)
|
||||
'PROVISIONING_PROFILE_SPECIFIER=$provisioningProfile',
|
||||
],
|
||||
workingDirectory: path.join(projectDirectory, 'ios'),
|
||||
workingDirectory: platformDirectory,
|
||||
canFail: true,
|
||||
);
|
||||
|
||||
if (testResultExit != 0) {
|
||||
final Directory? dumpDirectory = hostAgent.dumpDirectory;
|
||||
final Directory xcresultBundle = Directory(path.join(resultBundleTemp, 'result.xcresult'));
|
||||
if (dumpDirectory != null) {
|
||||
// Zip the test results to the artifacts directory for upload.
|
||||
final String zipPath = path.join(dumpDirectory.path,
|
||||
'$testName-${DateTime.now().toLocal().toIso8601String()}.zip');
|
||||
await exec(
|
||||
'zip',
|
||||
<String>[
|
||||
'-r',
|
||||
'-9',
|
||||
zipPath,
|
||||
'result.xcresult',
|
||||
],
|
||||
workingDirectory: resultBundleTemp,
|
||||
canFail: true, // Best effort to get the logs.
|
||||
);
|
||||
if (xcresultBundle.existsSync()) {
|
||||
// Zip the test results to the artifacts directory for upload.
|
||||
final String zipPath = path.join(dumpDirectory.path,
|
||||
'$testName-${DateTime.now().toLocal().toIso8601String()}.zip');
|
||||
await exec(
|
||||
'zip',
|
||||
<String>[
|
||||
'-r',
|
||||
'-9',
|
||||
zipPath,
|
||||
path.basename(xcresultBundle.path),
|
||||
],
|
||||
workingDirectory: resultBundleTemp,
|
||||
canFail: true, // Best effort to get the logs.
|
||||
);
|
||||
} else {
|
||||
print('xcresult bundle ${xcresultBundle.path} does not exist, skipping upload');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user