Upload logs before failing module_test_ios (#76341)

This commit is contained in:
Jenn Magder 2021-02-18 15:38:24 -08:00 committed by GitHub
parent 2659d6d18e
commit 050d49ae42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,12 +295,11 @@ Future<void> main() async {
section('Run platform unit tests'); section('Run platform unit tests');
final String resultBundleTemp = Directory.systemTemp.createTempSync('module_test_ios_xcresult.').path; final String resultBundleTemp = Directory.systemTemp.createTempSync('module_test_ios_xcresult.').path;
await testWithNewIOSSimulator('TestAdd2AppSim', (String deviceId) { await testWithNewIOSSimulator('TestAdd2AppSim', (String deviceId) async {
simulatorDeviceId = deviceId; simulatorDeviceId = deviceId;
final String resultBundlePath = path.join(resultBundleTemp, 'result'); final String resultBundlePath = path.join(resultBundleTemp, 'result');
return inDirectory(objectiveCHostApp, () => final int testResultExit = await exec(
exec(
'xcodebuild', 'xcodebuild',
<String>[ <String>[
'-workspace', '-workspace',
@ -320,10 +319,11 @@ Future<void> main() async {
'EXPANDED_CODE_SIGN_IDENTITY=-', 'EXPANDED_CODE_SIGN_IDENTITY=-',
'COMPILER_INDEX_STORE_ENABLE=NO', 'COMPILER_INDEX_STORE_ENABLE=NO',
], ],
)); workingDirectory: objectiveCHostApp.path,
} canFail: true,
); );
if (testResultExit != 0) {
// Zip the test results to the artifacts directory for upload. // Zip the test results to the artifacts directory for upload.
await inDirectory(resultBundleTemp, () { await inDirectory(resultBundleTemp, () {
final String zipPath = path.join(hostAgent.dumpDirectory.path, final String zipPath = path.join(hostAgent.dumpDirectory.path,
@ -340,6 +340,10 @@ Future<void> main() async {
); );
}); });
throw TaskResult.failure('Platform unit tests failed');
}
});
section('Fail building existing Objective-C iOS app if flutter script fails'); section('Fail building existing Objective-C iOS app if flutter script fails');
final String xcodebuildOutput = await inDirectory<String>(objectiveCHostApp, () => final String xcodebuildOutput = await inDirectory<String>(objectiveCHostApp, () =>
eval( eval(