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
c94648f9
Unverified
Commit
c94648f9
authored
Mar 15, 2021
by
omerlevran46
Committed by
GitHub
Mar 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fuchsia] remove no devices found from ffx parsing (#77651)
parent
59ea6192
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
10 deletions
+81
-10
adb.dart
dev/devicelab/lib/framework/adb.dart
+2
-5
utils.dart
dev/devicelab/lib/framework/utils.dart
+0
-2
fuchsia_ffx.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_ffx.dart
+0
-3
fuchsia_ffx_test.dart
...er_tools/test/general.shard/fuchsia/fuchsia_ffx_test.dart
+79
-0
No files found.
dev/devicelab/lib/framework/adb.dart
View file @
c94648f9
...
...
@@ -395,7 +395,6 @@ class FuchsiaDeviceDiscovery implements DeviceDiscovery {
final
Map
<
String
,
HealthCheckResult
>
results
=
<
String
,
HealthCheckResult
>{};
for
(
final
String
deviceId
in
await
discoverDevices
())
{
try
{
StringBuffer
stderr
;
final
int
resolveResult
=
await
exec
(
_ffx
,
<
String
>[
...
...
@@ -404,11 +403,9 @@ class FuchsiaDeviceDiscovery implements DeviceDiscovery {
'--format'
,
'a'
,
deviceId
,
],
stderr:
stderr
]
);
final
String
stderrOutput
=
stderr
.
toString
().
trim
();
if
(
resolveResult
==
0
&&
!
stderrOutput
.
contains
(
'No devices found'
))
{
if
(
resolveResult
==
0
)
{
results
[
'fuchsia-device-
$deviceId
'
]
=
HealthCheckResult
.
success
();
}
else
{
results
[
'fuchsia-device-
$deviceId
'
]
=
HealthCheckResult
.
failure
(
'Cannot resolve device
$deviceId
'
);
...
...
dev/devicelab/lib/framework/utils.dart
View file @
c94648f9
...
...
@@ -322,7 +322,6 @@ Future<int> exec(
List
<
String
>
arguments
,
{
Map
<
String
,
String
>
environment
,
bool
canFail
=
false
,
// as in, whether failures are ok. False means that they are fatal.
StringBuffer
stderr
,
// if not null, the stderr will be written here
String
workingDirectory
,
})
async
{
return
_execute
(
...
...
@@ -330,7 +329,6 @@ Future<int> exec(
arguments
,
environment:
environment
,
canFail
:
canFail
,
stderr:
stderr
,
workingDirectory:
workingDirectory
,
);
}
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_ffx.dart
View file @
c94648f9
...
...
@@ -93,9 +93,6 @@ class FuchsiaFfx {
_logger
.
printError
(
'ffx failed:
${result.stderr}
'
);
return
null
;
}
if
(
result
.
stderr
.
contains
(
'No devices found'
))
{
return
null
;
}
return
result
.
stdout
.
trim
();
}
}
packages/flutter_tools/test/general.shard/fuchsia/fuchsia_ffx_test.dart
View file @
c94648f9
...
...
@@ -130,6 +130,85 @@ void main() {
<
String
>[
'device1'
]);
});
});
group
(
'ffx resolve'
,
()
{
testWithoutContext
(
'ffx not found'
,
()
{
final
FuchsiaFfx
fuchsiaFfx
=
FuchsiaFfx
(
fuchsiaArtifacts:
fakeFuchsiaArtifacts
,
logger:
logger
,
processManager:
FakeProcessManager
.
any
(),
);
expect
(()
async
=>
fuchsiaFfx
.
list
(),
throwsToolExit
(
message:
'Fuchsia ffx tool not found.'
));
});
testWithoutContext
(
'unknown device'
,
()
async
{
ffx
.
createSync
();
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
ffx
.
path
,
'target'
,
'list'
,
'--format'
,
'a'
,
'unknown-device'
],
exitCode:
2
,
stderr:
'No devices found.'
,
),
]);
final
FuchsiaFfx
fuchsiaFfx
=
FuchsiaFfx
(
fuchsiaArtifacts:
fakeFuchsiaArtifacts
,
logger:
logger
,
processManager:
processManager
,
);
expect
(
await
fuchsiaFfx
.
resolve
(
'unknown-device'
),
isNull
);
expect
(
logger
.
errorText
,
'ffx failed: No devices found.
\n
'
);
});
testWithoutContext
(
'error'
,
()
async
{
ffx
.
createSync
();
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
ffx
.
path
,
'target'
,
'list'
,
'--format'
,
'a'
,
'error-device'
],
exitCode:
1
,
stderr:
'unexpected error'
,
),
]);
final
FuchsiaFfx
fuchsiaFfx
=
FuchsiaFfx
(
fuchsiaArtifacts:
fakeFuchsiaArtifacts
,
logger:
logger
,
processManager:
processManager
,
);
expect
(
await
fuchsiaFfx
.
resolve
(
'error-device'
),
isNull
);
expect
(
logger
.
errorText
,
contains
(
'unexpected error'
));
});
testWithoutContext
(
'valid device'
,
()
async
{
ffx
.
createSync
();
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
ffx
.
path
,
'target'
,
'list'
,
'--format'
,
'a'
,
'known-device'
],
exitCode:
0
,
stdout:
'1234-1234-1234-1234'
,
),
]);
final
FuchsiaFfx
fuchsiaFfx
=
FuchsiaFfx
(
fuchsiaArtifacts:
fakeFuchsiaArtifacts
,
logger:
logger
,
processManager:
processManager
,
);
expect
(
await
fuchsiaFfx
.
resolve
(
'known-device'
),
'1234-1234-1234-1234'
);
expect
(
logger
.
errorText
,
isEmpty
);
});
});
}
class
FakeFuchsiaArtifacts
extends
Fake
implements
FuchsiaArtifacts
{
...
...
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