Unverified Commit 67e4aeb6 authored by Christopher Fujino's avatar Christopher Fujino Committed by GitHub

Re-enable codesign integration test (#85507)

parent 425c37da
......@@ -284,7 +284,7 @@ class CodesignCommand extends Command<void> {
// First print all deviations from expectations
if (unsignedBinaries.isNotEmpty) {
stdio.printError('Found ${unsignedBinaries.length} unsigned binaries:');
unsignedBinaries.forEach(print);
unsignedBinaries.forEach(stdio.printError);
}
if (wrongEntitlementBinaries.isNotEmpty) {
......
......@@ -50,23 +50,7 @@ Directory get localFlutterRoot {
const FileSystem fileSystem = LocalFileSystem();
const Platform platform = LocalPlatform();
// If a test
if (platform.script.scheme == 'data') {
final RegExp pattern = RegExp(
r'(file:\/\/[^"]*[/\\]dev\/conductor[/\\][^"]+\.dart)',
multiLine: true,
);
final Match? match =
pattern.firstMatch(Uri.decodeFull(platform.script.path));
if (match == null) {
throw Exception(
'Cannot determine path of script!\n${platform.script.path}',
);
}
filePath = Uri.parse(match.group(1)!).path.replaceAll(r'%20', ' ');
} else {
filePath = platform.script.toFilePath();
}
filePath = platform.script.toFilePath();
final String checkoutsDirname = fileSystem.path.normalize(
fileSystem.path.join(
fileSystem.path.dirname(filePath),
......
......@@ -31,9 +31,13 @@ void main() {
stdio: stdio,
);
final Directory flutterRoot = _flutterRootFromDartBinary(
fileSystem.file(platform.executable),
);
final CommandRunner<void> runner = CommandRunner<void>('codesign-test', '')
..addCommand(
CodesignCommand(checkouts: checkouts, flutterRoot: localFlutterRoot));
CodesignCommand(checkouts: checkouts, flutterRoot: flutterRoot));
try {
await runner.run(<String>[
......@@ -44,7 +48,7 @@ void main() {
]);
} on ConductorException catch (e) {
print(stdio.error);
print(fixItInstructions);
print(_fixItInstructions);
fail(e.message);
} on Exception {
print('stdout:\n${stdio.stdout}');
......@@ -54,10 +58,17 @@ void main() {
}, onPlatform: <String, dynamic>{
'windows': const Skip('codesign command is only supported on macos'),
'linux': const Skip('codesign command is only supported on macos'),
}, skip: 'TODO(christopherfujino): https://github.com/flutter/flutter/issues/83448');
});
}
Directory _flutterRootFromDartBinary(File dartBinary) {
final Directory flutterDartSdkDir = dartBinary.parent.parent;
final Directory flutterCache = flutterDartSdkDir.parent;
final Directory flutterSdkDir = flutterCache.parent.parent;
return flutterSdkDir;
}
const String fixItInstructions = '''
const String _fixItInstructions = '''
Codesign integration test failed.
This means that the binary files found in the Flutter cache do not match those
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment