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
a4c58292
Commit
a4c58292
authored
Mar 10, 2017
by
Todd Volkert
Committed by
GitHub
Mar 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and enable broken flutter_tools tests (#8720)
(follow-on to #8698)
parent
7ede6b53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
6 deletions
+31
-6
ios_workflow.dart
packages/flutter_tools/lib/src/ios/ios_workflow.dart
+3
-1
analyze_continuously_test.dart
packages/flutter_tools/test/analyze_continuously_test.dart
+2
-2
ios_workflow_test.dart
packages/flutter_tools/test/src/ios/ios_workflow_test.dart
+26
-3
No files found.
packages/flutter_tools/lib/src/ios/ios_workflow.dart
View file @
a4c58292
...
...
@@ -31,6 +31,8 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
bool
get
hasIDeviceId
=>
exitsHappy
(<
String
>[
'idevice_id'
,
'-h'
]);
bool
get
hasIDeviceInstaller
=>
exitsHappy
(<
String
>[
'ideviceinstaller'
,
'-h'
]);
bool
get
hasIosDeploy
=>
exitsHappy
(<
String
>[
'ios-deploy'
,
'--version'
]);
String
get
iosDeployMinimumVersion
=>
'1.9.0'
;
...
...
@@ -132,7 +134,7 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
if
(
hasHomebrew
)
{
brewStatus
=
ValidationType
.
installed
;
if
(!
exitsHappy
(<
String
>[
'ideviceinstaller'
,
'-h'
])
)
{
if
(!
hasIDeviceInstaller
)
{
brewStatus
=
ValidationType
.
partial
;
messages
.
add
(
new
ValidationMessage
.
error
(
'ideviceinstaller not available; this is used to discover connected iOS devices.
\n
'
...
...
packages/flutter_tools/test/analyze_continuously_test.dart
View file @
a4c58292
...
...
@@ -65,10 +65,10 @@ void main() {
await
server
.
start
();
await
onDone
;
expect
(
errorCount
,
2
);
expect
(
errorCount
,
greaterThan
(
0
)
);
},
overrides:
<
Type
,
Generator
>{
OperatingSystemUtils:
()
=>
os
}
,
skip:
true
/* TODO(tvolkert): fix and enable */
);
});
}
void
_createSampleProject
(
Directory
directory
,
{
bool
brokenCode:
false
})
{
...
...
packages/flutter_tools/test/src/ios/ios_workflow_test.dart
View file @
a4c58292
...
...
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/doctor.dart'
;
import
'package:flutter_tools/src/ios/ios_workflow.dart'
;
import
'package:flutter_tools/src/ios/mac.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:process/process.dart'
;
import
'package:test/test.dart'
;
import
'../context.dart'
;
...
...
@@ -14,8 +15,11 @@ import '../context.dart';
void
main
(
)
{
group
(
'iOS Workflow validation'
,
()
{
MockXcode
xcode
;
MockProcessManager
processManager
;
setUp
(()
{
xcode
=
new
MockXcode
();
processManager
=
new
MockProcessManager
();
});
testUsingContext
(
'Emit missing status when nothing is installed'
,
()
async
{
...
...
@@ -121,14 +125,30 @@ void main() {
.
thenReturn
(
'Xcode 8.2.1
\n
Build version 8C1002
\n
'
);
when
(
xcode
.
isInstalledAndMeetsVersionCheck
).
thenReturn
(
true
);
when
(
xcode
.
eulaSigned
).
thenReturn
(
true
);
when
(
processManager
.
runSync
(
argThat
(
contains
(
'idevice_id'
))))
.
thenReturn
(
exitsHappy
);
when
(
processManager
.
run
(
argThat
(
contains
(
'idevice_id'
)),
workingDirectory:
any
,
environment:
any
))
.
thenReturn
(
exitsHappy
);
final
ValidationResult
result
=
await
new
IOSWorkflowTestTarget
().
validate
();
expect
(
result
.
type
,
ValidationType
.
installed
);
},
overrides:
<
Type
,
Generator
>{
Xcode:
()
=>
xcode
},
skip:
true
/* TODO(tvolkert): fix and enable */
);
},
overrides:
<
Type
,
Generator
>{
Xcode:
()
=>
xcode
,
ProcessManager:
()
=>
processManager
,
});
});
}
final
ProcessResult
exitsHappy
=
new
ProcessResult
(
1
,
// pid
0
,
// exitCode
''
,
// stdout
''
,
// stderr
);
class
MockXcode
extends
Mock
implements
Xcode
{}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
IOSWorkflowTestTarget
extends
IOSWorkflow
{
@override
...
...
@@ -142,4 +162,7 @@ class IOSWorkflowTestTarget extends IOSWorkflow {
@override
String
iosDeployVersionText
=
'1.9.0'
;
@override
bool
get
hasIDeviceInstaller
=>
true
;
}
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