mirror of
https://github.com/flutter/flutter
synced 2024-08-25 11:07:06 +00:00
Skip codesigning during native macOS integration tests (#92938)
This commit is contained in:
parent
f729043cb2
commit
dc20a6066f
|
@ -36,7 +36,11 @@ Future<void> main() async {
|
|||
section('Run platform unit tests');
|
||||
|
||||
final Device device = await devices.workingDevice;
|
||||
if (!await runXcodeTests(path.join(projectDirectory, 'ios'), 'id=${device.deviceId}', 'native_ui_tests_ios')) {
|
||||
if (!await runXcodeTests(
|
||||
platformDirectory: path.join(projectDirectory, 'ios'),
|
||||
destination: 'id=${device.deviceId}',
|
||||
testName: 'native_ui_tests_ios',
|
||||
)) {
|
||||
return TaskResult.failure('Platform unit tests failed');
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,12 @@ Future<void> main() async {
|
|||
|
||||
section('Run platform unit tests');
|
||||
|
||||
if (!await runXcodeTests(path.join(projectDirectory, 'macos'), 'platform=macOS', 'native_ui_tests_macos')) {
|
||||
if (!await runXcodeTests(
|
||||
platformDirectory: path.join(projectDirectory, 'macos'),
|
||||
destination: 'platform=macOS',
|
||||
testName: 'native_ui_tests_macos',
|
||||
skipCodesign: true,
|
||||
)) {
|
||||
return TaskResult.failure('Platform unit tests failed');
|
||||
}
|
||||
|
||||
|
|
|
@ -140,13 +140,22 @@ Future<void> removeIOSimulator(String deviceId) async {
|
|||
}
|
||||
}
|
||||
|
||||
Future<bool> runXcodeTests(String platformDirectory, String destination, String testName) async {
|
||||
Future<bool> runXcodeTests({
|
||||
required String platformDirectory,
|
||||
required String destination,
|
||||
required String testName,
|
||||
bool skipCodesign = false,
|
||||
}) 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';
|
||||
final String? codeSignStyle = environment['FLUTTER_XCODE_CODE_SIGN_STYLE'];
|
||||
final String? provisioningProfile = environment['FLUTTER_XCODE_PROVISIONING_PROFILE_SPECIFIER'];
|
||||
|
||||
String? developmentTeam;
|
||||
String? codeSignStyle;
|
||||
String? provisioningProfile;
|
||||
if (!skipCodesign) {
|
||||
// If not running on CI, inject the Flutter team code signing properties.
|
||||
developmentTeam = environment['FLUTTER_XCODE_DEVELOPMENT_TEAM'] ?? 'S8QB4VV633';
|
||||
codeSignStyle = environment['FLUTTER_XCODE_CODE_SIGN_STYLE'];
|
||||
provisioningProfile = environment['FLUTTER_XCODE_PROVISIONING_PROFILE_SPECIFIER'];
|
||||
}
|
||||
final String resultBundleTemp = Directory.systemTemp.createTempSync('flutter_xcresult.').path;
|
||||
final String resultBundlePath = path.join(resultBundleTemp, 'result');
|
||||
final int testResultExit = await exec(
|
||||
|
@ -164,7 +173,8 @@ Future<bool> runXcodeTests(String platformDirectory, String destination, String
|
|||
resultBundlePath,
|
||||
'test',
|
||||
'COMPILER_INDEX_STORE_ENABLE=NO',
|
||||
'DEVELOPMENT_TEAM=$developmentTeam',
|
||||
if (developmentTeam != null)
|
||||
'DEVELOPMENT_TEAM=$developmentTeam',
|
||||
if (codeSignStyle != null)
|
||||
'CODE_SIGN_STYLE=$codeSignStyle',
|
||||
if (provisioningProfile != null)
|
||||
|
|
|
@ -32,4 +32,4 @@ SPEC CHECKSUMS:
|
|||
|
||||
PODFILE CHECKSUM: b5c36ba411e4471a03727d0463fa17be341876c1
|
||||
|
||||
COCOAPODS: 1.10.2
|
||||
COCOAPODS: 1.11.2
|
||||
|
|
|
@ -18,9 +18,11 @@
|
|||
NSMenu *mainMenu = NSApplication.sharedApplication.mainMenu;
|
||||
XCTAssertEqual([mainMenu indexOfItemWithSubmenu:applicationMenu], 0);
|
||||
|
||||
XCTAssertEqual([mainMenu itemWithTitle:@"Edit"].submenu.numberOfItems, 19);
|
||||
XCTAssertEqual([mainMenu itemWithTitle:@"View"].submenu.numberOfItems, 1);
|
||||
XCTAssertEqual([mainMenu itemWithTitle:@"Window"].submenu.numberOfItems, 6);
|
||||
// The number of submenu items changes depending on what the OS decides to inject.
|
||||
// Just check there's at least one per menu item.
|
||||
XCTAssertGreaterThanOrEqual([mainMenu itemWithTitle:@"Edit"].submenu.numberOfItems, 1);
|
||||
XCTAssertGreaterThanOrEqual([mainMenu itemWithTitle:@"View"].submenu.numberOfItems, 1);
|
||||
XCTAssertGreaterThanOrEqual([mainMenu itemWithTitle:@"Window"].submenu.numberOfItems, 1);
|
||||
|
||||
XCTAssertNil(NSApplication.sharedApplication.helpMenu);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue