From 4329bea900a649736cbdb9110b8f717d755a4c3c Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Tue, 9 Feb 2021 16:10:40 -0800 Subject: [PATCH] Compress module_test_ios xcresult (#75736) --- dev/devicelab/bin/tasks/module_test_ios.dart | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dev/devicelab/bin/tasks/module_test_ios.dart b/dev/devicelab/bin/tasks/module_test_ios.dart index 5e848c0f2a..c1e8b3366b 100644 --- a/dev/devicelab/bin/tasks/module_test_ios.dart +++ b/dev/devicelab/bin/tasks/module_test_ios.dart @@ -291,10 +291,12 @@ Future main() async { } section('Run platform unit tests'); + + final String resultBundleTemp = Directory.systemTemp.createTempSync('module_test_ios_xcresult.').path; await testWithNewIOSSimulator('TestAdd2AppSim', (String deviceId) { simulatorDeviceId = deviceId; + final String resultBundlePath = path.join(resultBundleTemp, 'result'); - final String resultBundlePath = path.join(hostAgent.dumpDirectory.path, 'module_test_ios-objc-${DateTime.now().toLocal().toIso8601String()}'); return inDirectory(objectiveCHostApp, () => exec( 'xcodebuild', @@ -320,6 +322,22 @@ Future main() async { } ); + // Zip the test results to the artifacts directory for upload. + await inDirectory(resultBundleTemp, () { + final String zipPath = path.join(hostAgent.dumpDirectory.path, + 'module_test_ios-objc-${DateTime.now().toLocal().toIso8601String()}.zip'); + return exec( + 'zip', + [ + '-r', + '-9', + zipPath, + 'result.xcresult', + ], + canFail: true, // Best effort to get the logs. + ); + }); + section('Fail building existing Objective-C iOS app if flutter script fails'); final String xcodebuildOutput = await inDirectory(objectiveCHostApp, () => eval(