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
4f952829
Unverified
Commit
4f952829
authored
Jul 16, 2022
by
Christopher Fujino
Committed by
GitHub
Jul 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Remove shuffle from doctor test (#107744)
parent
6952408c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
24 deletions
+61
-24
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+32
-11
doctor_test.dart
...utter_tools/test/commands.shard/hermetic/doctor_test.dart
+29
-13
No files found.
packages/flutter_tools/lib/src/doctor.dart
View file @
4f952829
...
...
@@ -44,31 +44,52 @@ import 'windows/visual_studio_validator.dart';
import
'windows/windows_workflow.dart'
;
abstract
class
DoctorValidatorsProvider
{
// Allow tests to construct a [_DefaultDoctorValidatorsProvider] with explicit
// [FeatureFlags].
factory
DoctorValidatorsProvider
.
test
({
Platform
?
platform
,
required
FeatureFlags
featureFlags
,
})
{
return
_DefaultDoctorValidatorsProvider
(
featureFlags:
featureFlags
,
platform:
platform
??
FakePlatform
(),
);
}
/// The singleton instance, pulled from the [AppContext].
static
DoctorValidatorsProvider
get
_instance
=>
context
.
get
<
DoctorValidatorsProvider
>()!;
static
final
DoctorValidatorsProvider
defaultInstance
=
_DefaultDoctorValidatorsProvider
();
static
final
DoctorValidatorsProvider
defaultInstance
=
_DefaultDoctorValidatorsProvider
(
platform:
globals
.
platform
,
featureFlags:
featureFlags
,
);
List
<
DoctorValidator
>
get
validators
;
List
<
Workflow
>
get
workflows
;
}
class
_DefaultDoctorValidatorsProvider
implements
DoctorValidatorsProvider
{
_DefaultDoctorValidatorsProvider
({
required
this
.
platform
,
required
this
.
featureFlags
,
});
List
<
DoctorValidator
>?
_validators
;
List
<
Workflow
>?
_workflows
;
final
Platform
platform
;
final
FeatureFlags
featureFlags
;
final
LinuxWorkflow
linuxWorkflow
=
LinuxWorkflow
(
platform:
globals
.
platform
,
late
final
LinuxWorkflow
linuxWorkflow
=
LinuxWorkflow
(
platform:
platform
,
featureFlags:
featureFlags
,
);
final
WebWorkflow
webWorkflow
=
WebWorkflow
(
platform:
globals
.
platform
,
late
final
WebWorkflow
webWorkflow
=
WebWorkflow
(
platform:
platform
,
featureFlags:
featureFlags
,
);
final
MacOSWorkflow
macOSWorkflow
=
MacOSWorkflow
(
platform:
globals
.
platform
,
late
final
MacOSWorkflow
macOSWorkflow
=
MacOSWorkflow
(
platform:
platform
,
featureFlags:
featureFlags
,
);
...
...
@@ -80,17 +101,17 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider {
final
List
<
DoctorValidator
>
ideValidators
=
<
DoctorValidator
>[
if
(
androidWorkflow
!.
appliesToHostPlatform
)
...
AndroidStudioValidator
.
allValidators
(
globals
.
config
,
globals
.
platform
,
globals
.
fs
,
globals
.
userMessages
),
...
AndroidStudioValidator
.
allValidators
(
globals
.
config
,
platform
,
globals
.
fs
,
globals
.
userMessages
),
...
IntelliJValidator
.
installedValidators
(
fileSystem:
globals
.
fs
,
platform:
globals
.
platform
,
platform:
platform
,
userMessages:
userMessages
,
plistParser:
globals
.
plistParser
,
processManager:
globals
.
processManager
,
),
...
VsCodeValidator
.
installedValidators
(
globals
.
fs
,
globals
.
platform
,
globals
.
processManager
),
...
VsCodeValidator
.
installedValidators
(
globals
.
fs
,
platform
,
globals
.
processManager
),
];
final
ProxyValidator
proxyValidator
=
ProxyValidator
(
platform:
globals
.
platform
);
final
ProxyValidator
proxyValidator
=
ProxyValidator
(
platform:
platform
);
_validators
=
<
DoctorValidator
>[
FlutterValidator
(
fileSystem:
globals
.
fs
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart
View file @
4f952829
...
...
@@ -2,12 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(gspencergoog): Remove this tag once this test's state leaks/test
// dependencies have been fixed.
// https://github.com/flutter/flutter/issues/85160
// Fails with "flutter test --test-randomize-ordering-seed=20210723"
@Tags
(<
String
>[
'no-shuffle'
])
import
'dart:async'
;
import
'package:args/command_runner.dart'
;
...
...
@@ -17,6 +11,7 @@ import 'package:flutter_tools/src/android/android_studio_validator.dart';
import
'package:flutter_tools/src/android/android_workflow.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/terminal.dart'
;
import
'package:flutter_tools/src/base/user_messages.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
...
...
@@ -25,7 +20,6 @@ import 'package:flutter_tools/src/commands/doctor.dart';
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/doctor.dart'
;
import
'package:flutter_tools/src/doctor_validator.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/reporting/reporting.dart'
;
import
'package:flutter_tools/src/version.dart'
;
...
...
@@ -743,10 +737,15 @@ void main() {
});
testUsingContext
(
'WebWorkflow is a part of validator workflows if enabled'
,
()
async
{
expect
(
DoctorValidatorsProvider
.
defaultInstance
.
workflows
,
contains
(
isA
<
WebWorkflow
>()));
final
List
<
Workflow
>
workflows
=
DoctorValidatorsProvider
.
test
(
featureFlags:
TestFeatureFlags
(
isWebEnabled:
true
),
platform:
FakePlatform
(),
).
workflows
;
expect
(
workflows
,
contains
(
isA
<
WebWorkflow
>()),
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isWebEnabled:
true
),
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
ProcessManager:
()
=>
fakeProcessManager
,
});
...
...
@@ -769,13 +768,30 @@ void main() {
},
initializeFlutterRoot:
false
);
testUsingContext
(
'If android workflow is disabled, AndroidStudio validator is not included'
,
()
{
expect
(
DoctorValidatorsProvider
.
defaultInstance
.
validators
,
isNot
(
contains
(
isA
<
AndroidStudioValidator
>())));
expect
(
DoctorValidatorsProvider
.
defaultInstance
.
validators
,
isNot
(
contains
(
isA
<
NoAndroidStudioValidator
>())));
final
DoctorValidatorsProvider
provider
=
DoctorValidatorsProvider
.
test
(
featureFlags:
TestFeatureFlags
(
isAndroidEnabled:
false
),
);
expect
(
provider
.
validators
,
isNot
(
contains
(
isA
<
AndroidStudioValidator
>())));
expect
(
provider
.
validators
,
isNot
(
contains
(
isA
<
NoAndroidStudioValidator
>())));
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isAndroidEnabled
:
false
),
AndroidWorkflow:
()
=>
FakeAndroidWorkflow
(
appliesToHostPlatform
:
false
),
});
}
class
FakeAndroidWorkflow
extends
Fake
implements
AndroidWorkflow
{
FakeAndroidWorkflow
({
this
.
canListDevices
=
true
,
this
.
appliesToHostPlatform
=
true
,
});
@override
final
bool
canListDevices
;
@override
final
bool
appliesToHostPlatform
;
}
class
NoOpDoctor
implements
Doctor
{
@override
bool
get
canLaunchAnything
=>
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