mirror of
https://github.com/flutter/packages.git
synced 2025-08-24 19:42:17 +08:00
[ci] Upload screenshots, logs, and Xcode test results for drive and integration_test runs (#7430)
1. Native Xcode tests will output a helpful "xcresult" package on failure containing logs, screenshots, and screen recordings. Zip and upload these results when tests fail. 2. Pass `flutter test --debug-logs-dir` flag to upload logs like https://github.com/flutter/flutter/pull/142643. 3. Pass `flutter drive --screenshot` flag to upload screenshots on timeout like https://github.com/flutter/flutter/pull/96973. Example of [failing Xcode analyzer build](https://ci.chromium.org/ui/p/flutter/builders/try/Mac_arm64%20ios_platform_tests_shard_5%20master/17374/overview) has the [zipped xcresult](https://storage.googleapis.com/flutter_logs/flutter/ff98c32e-18ca-4ad4-a910-9db1d7f7e4b0/xcode%20analyze/ff98c32e-18ca-4ad4-a910-9db1d7f7e4b0/xcodebuild-2024-10-25T09:56:46.440913.zip) attached as a log.  The unzipped xcresult looks like this in Xcode:  A [failing "native test" step build](https://ci.chromium.org/ui/p/flutter/builders/try/Mac_arm64%20macos_platform_tests%20master%20-%20packages/17315/overview):  Fixes https://github.com/flutter/flutter/issues/144795
This commit is contained in:
@ -97,10 +97,10 @@ class XcodeAnalyzeCommand extends PackageLoopingCommand {
|
||||
multiplePlatformsRequested ? failures : <String>[]);
|
||||
}
|
||||
|
||||
/// Analyzes [plugin] for [platform], returning true if it passed analysis.
|
||||
/// Analyzes [plugin] for [targetPlatform], returning true if it passed analysis.
|
||||
Future<bool> _analyzePlugin(
|
||||
RepositoryPackage plugin,
|
||||
String platform, {
|
||||
String targetPlatform, {
|
||||
List<String> extraFlags = const <String>[],
|
||||
}) async {
|
||||
bool passing = true;
|
||||
@ -108,25 +108,26 @@ class XcodeAnalyzeCommand extends PackageLoopingCommand {
|
||||
// Running tests and static analyzer.
|
||||
final String examplePath = getRelativePosixPath(example.directory,
|
||||
from: plugin.directory.parent);
|
||||
print('Running $platform tests and analyzer for $examplePath...');
|
||||
print('Running $targetPlatform tests and analyzer for $examplePath...');
|
||||
final int exitCode = await _xcode.runXcodeBuild(
|
||||
example.directory,
|
||||
platform,
|
||||
targetPlatform,
|
||||
// Clean before analyzing to remove cached swiftmodules from previous
|
||||
// runs, which can cause conflicts.
|
||||
actions: <String>['clean', 'analyze'],
|
||||
workspace: '${platform.toLowerCase()}/Runner.xcworkspace',
|
||||
workspace: '${targetPlatform.toLowerCase()}/Runner.xcworkspace',
|
||||
scheme: 'Runner',
|
||||
configuration: 'Debug',
|
||||
hostPlatform: platform,
|
||||
extraFlags: <String>[
|
||||
...extraFlags,
|
||||
'GCC_TREAT_WARNINGS_AS_ERRORS=YES',
|
||||
],
|
||||
);
|
||||
if (exitCode == 0) {
|
||||
printSuccess('$examplePath ($platform) passed analysis.');
|
||||
printSuccess('$examplePath ($targetPlatform) passed analysis.');
|
||||
} else {
|
||||
printError('$examplePath ($platform) failed analysis.');
|
||||
printError('$examplePath ($targetPlatform) failed analysis.');
|
||||
passing = false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user