Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
93b358f9
Unverified
Commit
93b358f9
authored
Jul 22, 2021
by
Christopher Fujino
Committed by
GitHub
Jul 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cast error in codesign sub-command (#86890)
parent
03de6166
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
3 deletions
+94
-3
codesign.dart
dev/conductor/lib/codesign.dart
+9
-3
codesign_test.dart
dev/conductor/test/codesign_test.dart
+85
-0
No files found.
dev/conductor/lib/codesign.dart
View file @
93b358f9
...
@@ -316,10 +316,16 @@ class CodesignCommand extends Command<void> {
...
@@ -316,10 +316,16 @@ class CodesignCommand extends Command<void> {
'Test failed because unexpected binaries found in the cache.'
);
'Test failed because unexpected binaries found in the cache.'
);
}
}
final
String
?
desiredRevision
=
argResults
![
kRevision
]
as
String
?;
if
(
desiredRevision
==
null
)
{
stdio
.
printStatus
(
stdio
.
printStatus
(
'Verified that binaries for commit
${argResults![kRevision] as String}
are codesigned and have '
'Verified that binaries are codesigned and have expected entitlements.'
);
}
else
{
stdio
.
printStatus
(
'Verified that binaries for commit
$desiredRevision
are codesigned and have '
'expected entitlements.'
);
'expected entitlements.'
);
}
}
}
List
<
String
>?
_allBinaryPaths
;
List
<
String
>?
_allBinaryPaths
;
...
...
dev/conductor/test/codesign_test.dart
View file @
93b358f9
...
@@ -81,6 +81,90 @@ void main() {
...
@@ -81,6 +81,90 @@ void main() {
);
);
});
});
test
(
'does not fail if --revision flag not provided'
,
()
async
{
final
List
<
FakeCommand
>
codesignCheckCommands
=
<
FakeCommand
>[];
for
(
final
String
bin
in
binariesWithEntitlements
)
{
codesignCheckCommands
.
add
(
FakeCommand
(
command:
<
String
>[
'codesign'
,
'-vvv'
,
bin
],
),
);
codesignCheckCommands
.
add
(
FakeCommand
(
command:
<
String
>[
'codesign'
,
'--display'
,
'--entitlements'
,
':-'
,
bin
],
stdout:
expectedEntitlements
.
join
(
'
\n
'
),
),
);
}
for
(
final
String
bin
in
binariesWithoutEntitlements
)
{
codesignCheckCommands
.
add
(
FakeCommand
(
command:
<
String
>[
'codesign'
,
'-vvv'
,
bin
],
),
);
}
createRunner
(
commands:
<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'git'
,
'clone'
,
'--origin'
,
'upstream'
,
'--'
,
'file://
$flutterRoot
/'
,
'
${checkoutsParentDirectory}
flutter_conductor_checkouts/framework'
,
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
,
],
stdout:
revision
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
,
],
stdout:
revision
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
revision
,
]),
const
FakeCommand
(
command:
<
String
>[
flutterBin
,
'help'
,
]),
const
FakeCommand
(
command:
<
String
>[
flutterBin
,
'help'
,
]),
const
FakeCommand
(
command:
<
String
>[
flutterBin
,
'precache'
,
'--android'
,
'--ios'
,
'--macos'
,
]),
FakeCommand
(
command:
const
<
String
>[
'find'
,
'
${checkoutsParentDirectory}
flutter_conductor_checkouts/framework/bin/cache'
,
'-type'
,
'f'
,
],
stdout:
allBinaries
.
join
(
'
\n
'
),
),
for
(
String
bin
in
allBinaries
)
FakeCommand
(
command:
<
String
>[
'file'
,
'--mime-type'
,
'-b'
,
bin
],
stdout:
'application/x-mach-binary'
,
),
...
codesignCheckCommands
,
]);
await
runner
.
run
(<
String
>[
'codesign'
,
'--
$kVerify
'
]);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
expect
(
stdio
.
stdout
,
contains
(
'Verified that binaries are codesigned and have expected entitlements'
));
});
test
(
'succeeds if every binary is codesigned and has correct entitlements'
,
()
async
{
test
(
'succeeds if every binary is codesigned and has correct entitlements'
,
()
async
{
final
List
<
FakeCommand
>
codesignCheckCommands
=
<
FakeCommand
>[];
final
List
<
FakeCommand
>
codesignCheckCommands
=
<
FakeCommand
>[];
for
(
final
String
bin
in
binariesWithEntitlements
)
{
for
(
final
String
bin
in
binariesWithEntitlements
)
{
...
@@ -156,6 +240,7 @@ void main() {
...
@@ -156,6 +240,7 @@ void main() {
]);
]);
await
runner
.
run
(<
String
>[
'codesign'
,
'--
$kVerify
'
,
'--
$kRevision
'
,
revision
]);
await
runner
.
run
(<
String
>[
'codesign'
,
'--
$kVerify
'
,
'--
$kRevision
'
,
revision
]);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
expect
(
stdio
.
stdout
,
contains
(
'Verified that binaries for commit
$revision
are codesigned and have expected entitlements'
));
});
});
test
(
'fails if a single binary is not codesigned'
,
()
async
{
test
(
'fails if a single binary is not codesigned'
,
()
async
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment