-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
On native iOS Xcode build test failures upload the xcresult bundle to the logs location so we can open it in Xcode and see the screenshots, etc. This is possible as of #121535.
This is where it would be updated:
https://github.com/flutter/packages/blob/903f03add169c39d3f19bc70980af3f0862869a9/script/tool/lib/src/common/xcode.dart#L34-L56
Here is how it's done in the framework repo:
flutter/dev/devicelab/lib/framework/ios.dart
Lines 194 to 219 in 874804e
| final String resultBundleTemp = Directory.systemTemp.createTempSync('flutter_xcresult.').path; | |
| final String resultBundlePath = path.join(resultBundleTemp, 'result'); | |
| final int testResultExit = await exec( | |
| 'xcodebuild', | |
| <String>[ | |
| '-workspace', | |
| 'Runner.xcworkspace', | |
| '-scheme', | |
| 'Runner', | |
| '-configuration', | |
| configuration, | |
| '-destination', | |
| destination, | |
| '-resultBundlePath', | |
| resultBundlePath, | |
| 'test', | |
| 'COMPILER_INDEX_STORE_ENABLE=NO', | |
| if (developmentTeam != null) | |
| 'DEVELOPMENT_TEAM=$developmentTeam', | |
| if (codeSignStyle != null) | |
| 'CODE_SIGN_STYLE=$codeSignStyle', | |
| if (provisioningProfile != null) | |
| 'PROVISIONING_PROFILE_SPECIFIER=$provisioningProfile', | |
| ], | |
| workingDirectory: platformDirectory, | |
| canFail: true, |
flutter/dev/devicelab/lib/framework/ios.dart
Lines 226 to 241 in 874804e
| 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', | |
| '-q', | |
| zipPath, | |
| path.basename(xcresultBundle.path), | |
| ], | |
| workingDirectory: resultBundleTemp, | |
| canFail: true, // Best effort to get the logs. | |
| ); |
where dumpDirectory is platform.environment['FLUTTER_LOGS_DIR']
flutter/dev/devicelab/lib/framework/host_agent.dart
Lines 26 to 28 in 36e09ff
| final String? directoryPath = _platform.environment['FLUTTER_LOGS_DIR']; | |
| if (directoryPath != null) { | |
| _dumpDirectory = _fileSystem.directory(directoryPath)..createSync(recursive: true); |
This would particularly be helpful when tests are run in parallel because evidently it doesn't show the failures in stdout:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8754096679487031185/+/u/Run_package_tests/native_test/stdout