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
1a685e03
Unverified
Commit
1a685e03
authored
Apr 02, 2020
by
Christopher Fujino
Committed by
GitHub
Apr 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve downgrade-upgrade integration test (#53775)
parent
6fddb7ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
downgrade_upgrade_integration_test.dart
...integration.shard/downgrade_upgrade_integration_test.dart
+15
-7
No files found.
packages/flutter_tools/test/integration.shard/downgrade_upgrade_integration_test.dart
View file @
1a685e03
...
@@ -12,8 +12,8 @@ import 'package:process/process.dart';
...
@@ -12,8 +12,8 @@ import 'package:process/process.dart';
import
'../src/common.dart'
;
import
'../src/common.dart'
;
const
String
_kInitialVersion
=
'v1.9.1
+hotfix.6
'
;
const
String
_kInitialVersion
=
'v1.9.1'
;
const
String
_kBranch
=
'
stable
'
;
const
String
_kBranch
=
'
dev
'
;
const
FileSystem
fileSystem
=
LocalFileSystem
();
const
FileSystem
fileSystem
=
LocalFileSystem
();
const
ProcessManager
processManager
=
LocalProcessManager
();
const
ProcessManager
processManager
=
LocalProcessManager
();
final
Stdio
stdio
=
Stdio
();
final
Stdio
stdio
=
Stdio
();
...
@@ -50,20 +50,23 @@ void main() {
...
@@ -50,20 +50,23 @@ void main() {
final
Directory
testDirectory
=
parentDirectory
.
childDirectory
(
'flutter'
);
final
Directory
testDirectory
=
parentDirectory
.
childDirectory
(
'flutter'
);
testDirectory
.
createSync
(
recursive:
true
);
testDirectory
.
createSync
(
recursive:
true
);
int
exitCode
=
0
;
// Enable longpaths for windows integration test.
// Enable longpaths for windows integration test.
await
processManager
.
run
(<
String
>[
await
processManager
.
run
(<
String
>[
'git'
,
'config'
,
'--system'
,
'core.longpaths'
,
'true'
,
'git'
,
'config'
,
'--system'
,
'core.longpaths'
,
'true'
,
]);
]);
// Step 1. Clone the dev branch of flutter into the test directory.
// Step 1. Clone the dev branch of flutter into the test directory.
await
processUtils
.
stream
(<
String
>[
exitCode
=
await
processUtils
.
stream
(<
String
>[
'git'
,
'git'
,
'clone'
,
'clone'
,
'https://github.com/flutter/flutter.git'
,
'https://github.com/flutter/flutter.git'
,
],
workingDirectory:
parentDirectory
.
path
,
trace:
true
);
],
workingDirectory:
parentDirectory
.
path
,
trace:
true
);
expect
(
exitCode
,
0
);
// Step 2. Switch to the dev branch.
// Step 2. Switch to the dev branch.
await
processUtils
.
stream
(<
String
>[
exitCode
=
await
processUtils
.
stream
(<
String
>[
'git'
,
'git'
,
'checkout'
,
'checkout'
,
'--track'
,
'--track'
,
...
@@ -71,22 +74,26 @@ void main() {
...
@@ -71,22 +74,26 @@ void main() {
_kBranch
,
_kBranch
,
'origin/
$_kBranch
'
,
'origin/
$_kBranch
'
,
],
workingDirectory:
testDirectory
.
path
,
trace:
true
);
],
workingDirectory:
testDirectory
.
path
,
trace:
true
);
expect
(
exitCode
,
0
);
// Step 3. Revert to a prior version.
// Step 3. Revert to a prior version.
await
processUtils
.
stream
(<
String
>[
exitCode
=
await
processUtils
.
stream
(<
String
>[
'git'
,
'git'
,
'reset'
,
'reset'
,
'--hard'
,
'--hard'
,
_kInitialVersion
,
_kInitialVersion
,
],
workingDirectory:
testDirectory
.
path
,
trace:
true
);
],
workingDirectory:
testDirectory
.
path
,
trace:
true
);
expect
(
exitCode
,
0
);
// Step 4. Upgrade to the newest dev. This should update the persistent
// Step 4. Upgrade to the newest dev. This should update the persistent
// tool state with the sha for v1.14.3
// tool state with the sha for v1.14.3
await
processUtils
.
stream
(<
String
>[
exitCode
=
await
processUtils
.
stream
(<
String
>[
flutterBin
,
flutterBin
,
'upgrade'
,
'upgrade'
,
'--verbose'
,
'--working-directory=
${testDirectory.path}
'
'--working-directory=
${testDirectory.path}
'
],
workingDirectory:
testDirectory
.
path
,
trace:
true
);
],
workingDirectory:
testDirectory
.
path
,
trace:
true
);
expect
(
exitCode
,
0
);
// Step 5. Verify that the version is different.
// Step 5. Verify that the version is different.
final
RunResult
versionResult
=
await
processUtils
.
run
(<
String
>[
final
RunResult
versionResult
=
await
processUtils
.
run
(<
String
>[
...
@@ -101,12 +108,13 @@ void main() {
...
@@ -101,12 +108,13 @@ void main() {
expect
(
versionResult
.
stdout
,
isNot
(
contains
(
_kInitialVersion
)));
expect
(
versionResult
.
stdout
,
isNot
(
contains
(
_kInitialVersion
)));
// Step 6. Downgrade back to initial version.
// Step 6. Downgrade back to initial version.
await
processUtils
.
stream
(<
String
>[
exitCode
=
await
processUtils
.
stream
(<
String
>[
flutterBin
,
flutterBin
,
'downgrade'
,
'downgrade'
,
'--no-prompt'
,
'--no-prompt'
,
'--working-directory=
${testDirectory.path}
'
'--working-directory=
${testDirectory.path}
'
],
workingDirectory:
testDirectory
.
path
,
trace:
true
);
],
workingDirectory:
testDirectory
.
path
,
trace:
true
);
expect
(
exitCode
,
0
);
// Step 7. Verify downgraded version matches original version.
// Step 7. Verify downgraded version matches original version.
final
RunResult
oldVersionResult
=
await
processUtils
.
run
(<
String
>[
final
RunResult
oldVersionResult
=
await
processUtils
.
run
(<
String
>[
...
...
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