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
ce3c3d2a
Unverified
Commit
ce3c3d2a
authored
Apr 13, 2021
by
Anurag Roy
Committed by
GitHub
Apr 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Show upstream remote in `flutter doctor -v` (#80101)
parent
257f5112
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
2 deletions
+75
-2
user_messages.dart
packages/flutter_tools/lib/src/base/user_messages.dart
+2
-0
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+4
-0
flutter_validator_test.dart
...tter_tools/test/general.shard/flutter_validator_test.dart
+69
-2
No files found.
packages/flutter_tools/lib/src/base/user_messages.dart
View file @
ce3c3d2a
...
...
@@ -20,6 +20,8 @@ class UserMessages {
'Flutter version
$version
at
$flutterRoot
'
;
String
flutterRevision
(
String
revision
,
String
age
,
String
date
)
=>
'Framework revision
$revision
(
$age
),
$date
'
;
String
flutterUpstreamRepositoryUrl
(
String
url
)
=>
'Upstream repository
$url
'
;
String
flutterGitUrl
(
String
url
)
=>
'FLUTTER_GIT_URL =
$url
'
;
String
engineRevision
(
String
revision
)
=>
'Engine revision
$revision
'
;
String
dartRevision
(
String
revision
)
=>
'Dart version
$revision
'
;
String
pubMirrorURL
(
String
url
)
=>
'Pub download mirror
$url
'
;
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
ce3c3d2a
...
...
@@ -436,6 +436,10 @@ class FlutterValidator extends DoctorValidator {
frameworkVersion
,
_flutterRoot
(),
)));
messages
.
add
(
ValidationMessage
(
_userMessages
.
flutterUpstreamRepositoryUrl
(
version
.
repositoryUrl
??
'unknown'
)));
if
(
_platform
.
environment
.
containsKey
(
'FLUTTER_GIT_URL'
))
{
messages
.
add
(
ValidationMessage
(
_userMessages
.
flutterGitUrl
(
_platform
.
environment
[
'FLUTTER_GIT_URL'
])));
}
messages
.
add
(
ValidationMessage
(
_userMessages
.
flutterRevision
(
version
.
frameworkRevisionShort
,
version
.
frameworkAge
,
...
...
packages/flutter_tools/test/general.shard/flutter_validator_test.dart
View file @
ce3c3d2a
...
...
@@ -118,11 +118,11 @@ void main() {
expect
(
await
flutterValidator
.
validate
(),
_matchDoctorValidation
(
validationType:
ValidationType
.
partial
,
statusInfo:
'Channel unknown, 0.0.0, on Windows, locale en_US.UTF-8'
,
messages:
const
<
ValidationMessage
>[
messages:
con
tainsAll
(
con
st
<
ValidationMessage
>[
ValidationMessage
(
'Flutter version 0.0.0 at sdk/flutter'
),
ValidationMessage
.
error
(
'version error'
),
]),
);
)
)
;
});
testWithoutContext
(
'FlutterValidator shows mirrors on pub and flutter cloud storage'
,
()
async
{
...
...
@@ -159,6 +159,73 @@ void main() {
])
));
});
testWithoutContext
(
'FlutterValidator shows FLUTTER_GIT_URL environment variable when set'
,
()
async
{
final
FlutterValidator
flutterValidator
=
FlutterValidator
(
platform:
FakePlatform
(
localeName:
'en_US.UTF-8'
,
environment:
<
String
,
String
>
{
'FLUTTER_GIT_URL'
:
'https://githubmirror.com/flutter.git'
,
},
),
flutterVersion:
()
=>
FakeFlutterVersion
(
frameworkVersion:
'1.0.0'
),
userMessages:
UserMessages
(),
artifacts:
Artifacts
.
test
(),
fileSystem:
MemoryFileSystem
.
test
(),
processManager:
FakeProcessManager
.
any
(),
operatingSystemUtils:
FakeOperatingSystemUtils
(
name:
'Linux'
),
flutterRoot:
()
=>
'sdk/flutter'
,
);
expect
(
await
flutterValidator
.
validate
(),
_matchDoctorValidation
(
validationType:
ValidationType
.
installed
,
statusInfo:
'Channel unknown, 1.0.0, on Linux, locale en_US.UTF-8'
,
messages:
contains
(
const
ValidationMessage
(
'FLUTTER_GIT_URL = https://githubmirror.com/flutter.git'
)),
));
});
group
(
'FlutterValidator shows flutter upstream remote'
,
()
{
testWithoutContext
(
'default url'
,
()
async
{
final
FlutterValidator
flutterValidator
=
FlutterValidator
(
platform:
FakePlatform
(
localeName:
'en_US.UTF-8'
),
flutterVersion:
()
=>
FakeFlutterVersion
(
frameworkVersion:
'1.0.0'
),
userMessages:
UserMessages
(),
artifacts:
Artifacts
.
test
(),
fileSystem:
MemoryFileSystem
.
test
(),
processManager:
FakeProcessManager
.
any
(),
operatingSystemUtils:
FakeOperatingSystemUtils
(
name:
'Linux'
),
flutterRoot:
()
=>
'sdk/flutter'
,
);
expect
(
await
flutterValidator
.
validate
(),
_matchDoctorValidation
(
validationType:
ValidationType
.
installed
,
statusInfo:
'Channel unknown, 1.0.0, on Linux, locale en_US.UTF-8'
,
messages:
contains
(
const
ValidationMessage
(
'Upstream repository https://github.com/flutter/flutter.git'
)),
));
});
testWithoutContext
(
'unknown url if upstream is null'
,
()
async
{
final
FlutterValidator
flutterValidator
=
FlutterValidator
(
platform:
FakePlatform
(
localeName:
'en_US.UTF-8'
),
flutterVersion:
()
=>
FakeFlutterVersion
(
frameworkVersion:
'1.0.0'
,
repositoryUrl:
null
,
),
userMessages:
UserMessages
(),
artifacts:
Artifacts
.
test
(),
fileSystem:
MemoryFileSystem
.
test
(),
processManager:
FakeProcessManager
.
any
(),
operatingSystemUtils:
FakeOperatingSystemUtils
(
name:
'Linux'
),
flutterRoot:
()
=>
'sdk/flutter'
,
);
expect
(
await
flutterValidator
.
validate
(),
_matchDoctorValidation
(
validationType:
ValidationType
.
installed
,
statusInfo:
'Channel unknown, 1.0.0, on Linux, locale en_US.UTF-8'
,
messages:
contains
(
const
ValidationMessage
(
'Upstream repository unknown'
)),
));
});
});
}
class
FakeOperatingSystemUtils
extends
Fake
implements
OperatingSystemUtils
{
...
...
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