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
f6543467
Unverified
Commit
f6543467
authored
Sep 23, 2020
by
Jenn Magder
Committed by
GitHub
Sep 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check git commands in Flutter version check test (#66406)
parent
fb816326
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
version.dart
packages/flutter_tools/lib/src/version.dart
+1
-1
version_test.dart
packages/flutter_tools/test/general.shard/version_test.dart
+49
-1
No files found.
packages/flutter_tools/lib/src/version.dart
View file @
f6543467
...
...
@@ -398,7 +398,7 @@ class FlutterVersion {
lenient:
false
));
}
on
VersionCheckError
{
// Don't perform the update check if the ver
is
on check failed.
// Don't perform the update check if the ver
si
on check failed.
return
;
}
...
...
packages/flutter_tools/test/general.shard/version_test.dart
View file @
f6543467
...
...
@@ -28,8 +28,10 @@ final DateTime _stampOutOfDate = _testClock.ago(FlutterVersion.checkAgeConsidere
void
main
(
)
{
MockProcessManager
mockProcessManager
;
MockCache
mockCache
;
FakeProcessManager
processManager
;
setUp
(()
{
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[]);
mockProcessManager
=
MockProcessManager
();
mockCache
=
MockCache
();
});
...
...
@@ -60,11 +62,57 @@ void main() {
expectSetStamp:
true
,
channel:
channel
,
);
processManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'-c'
,
'log.showSignature=false'
,
'log'
,
'-n'
,
'1'
,
'--pretty=format:%H'
],
stdout:
'1234abcd'
,
));
processManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'tag'
,
'--points-at'
,
'HEAD'
],
));
processManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'describe'
,
'--match'
,
'*.*.*'
,
'--first-parent'
,
'--long'
,
'--tags'
],
stdout:
'0.1.2-3-1234abcd'
,
));
processManager
.
addCommand
(
FakeCommand
(
command:
const
<
String
>[
'git'
,
'rev-parse'
,
'--abbrev-ref'
,
'--symbolic'
,
'@{u}'
],
stdout:
channel
,
));
processManager
.
addCommand
(
FakeCommand
(
command:
const
<
String
>[
'git'
,
'-c'
,
'log.showSignature=false'
,
'log'
,
'-n'
,
'1'
,
'--pretty=format:%ad'
,
'--date=iso'
],
stdout:
getChannelUpToDateVersion
().
toString
(),
));
processManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'remote'
],
));
processManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'remote'
,
'add'
,
'__flutter_version_check__'
,
'https://github.com/flutter/flutter.git'
],
));
processManager
.
addCommand
(
FakeCommand
(
command:
<
String
>[
'git'
,
'fetch'
,
'__flutter_version_check__'
,
channel
],
));
processManager
.
addCommand
(
FakeCommand
(
command:
<
String
>[
'git'
,
'-c'
,
'log.showSignature=false'
,
'log'
,
'__flutter_version_check__/
$channel
'
,
'-n'
,
'1'
,
'--pretty=format:%ad'
,
'--date=iso'
],
stdout:
getChannelOutOfDateVersion
().
toString
(),
));
processManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'remote'
],
));
await
globals
.
flutterVersion
.
checkFlutterVersionFreshness
();
_expectVersionMessage
(
''
);
expect
(
processManager
.
hasRemainingExpectations
,
isFalse
);
},
overrides:
<
Type
,
Generator
>{
FlutterVersion:
()
=>
FlutterVersion
(
_testClock
),
ProcessManager:
()
=>
mockP
rocessManager
,
ProcessManager:
()
=>
p
rocessManager
,
Cache:
()
=>
mockCache
,
});
...
...
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