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
843083c9
Unverified
Commit
843083c9
authored
May 20, 2021
by
Christopher Fujino
Committed by
GitHub
May 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "[flutter_conductor] Auto apply dart revision (#82601)" (#82983)
This reverts commit
e86f9c7a
.
parent
e86f9c7a
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
282 deletions
+23
-282
globals.dart
dev/tools/lib/globals.dart
+3
-8
conductor_state.pb.dart
dev/tools/lib/proto/conductor_state.pb.dart
+0
-18
conductor_state.pbjson.dart
dev/tools/lib/proto/conductor_state.pbjson.dart
+1
-2
conductor_state.proto
dev/tools/lib/proto/conductor_state.proto
+0
-3
repository.dart
dev/tools/lib/repository.dart
+0
-45
start.dart
dev/tools/lib/start.dart
+8
-27
state.dart
dev/tools/lib/state.dart
+0
-3
repository_test.dart
dev/tools/test/repository_test.dart
+6
-131
start_test.dart
dev/tools/test/start_test.dart
+5
-45
No files found.
dev/tools/lib/globals.dart
View file @
843083c9
...
@@ -95,25 +95,20 @@ bool assertsEnabled() {
...
@@ -95,25 +95,20 @@ bool assertsEnabled() {
///
///
/// The environment is favored over CLI args since the latter can have a default
/// The environment is favored over CLI args since the latter can have a default
/// value, which the environment should be able to override.
/// value, which the environment should be able to override.
String
?
getValueFromEnvOrArgs
(
String
getValueFromEnvOrArgs
(
String
name
,
String
name
,
ArgResults
argResults
,
ArgResults
argResults
,
Map
<
String
,
String
>
env
,
{
Map
<
String
,
String
>
env
,
bool
allowNull
=
false
,
}
)
{
)
{
final
String
envName
=
fromArgToEnvName
(
name
);
final
String
envName
=
fromArgToEnvName
(
name
);
if
(
env
[
envName
]
!=
null
)
{
if
(
env
[
envName
]
!=
null
)
{
return
env
[
envName
];
return
env
[
envName
]
!
;
}
}
final
String
?
argValue
=
argResults
[
name
]
as
String
?;
final
String
?
argValue
=
argResults
[
name
]
as
String
?;
if
(
argValue
!=
null
)
{
if
(
argValue
!=
null
)
{
return
argValue
;
return
argValue
;
}
}
if
(
allowNull
)
{
return
null
;
}
throw
ConductorException
(
throw
ConductorException
(
'Expected either the CLI arg --
$name
or the environment variable
$envName
'
'Expected either the CLI arg --
$name
or the environment variable
$envName
'
'to be provided!'
);
'to be provided!'
);
...
...
dev/tools/lib/proto/conductor_state.pb.dart
View file @
843083c9
...
@@ -202,8 +202,6 @@ class Repository extends $pb.GeneratedMessage {
...
@@ -202,8 +202,6 @@ class Repository extends $pb.GeneratedMessage {
..
pc
<
Cherrypick
>(
..
pc
<
Cherrypick
>(
7
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_field_names'
)
?
''
:
'cherrypicks'
,
$pb
.
PbFieldType
.
PM
,
7
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_field_names'
)
?
''
:
'cherrypicks'
,
$pb
.
PbFieldType
.
PM
,
subBuilder:
Cherrypick
.
create
)
subBuilder:
Cherrypick
.
create
)
..
aOS
(
8
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_field_names'
)
?
''
:
'dartRevision'
,
protoName:
'dartRevision'
)
..
hasRequiredFields
=
false
;
..
hasRequiredFields
=
false
;
Repository
.
_
()
:
super
();
Repository
.
_
()
:
super
();
...
@@ -215,7 +213,6 @@ class Repository extends $pb.GeneratedMessage {
...
@@ -215,7 +213,6 @@ class Repository extends $pb.GeneratedMessage {
Remote
upstream
,
Remote
upstream
,
Remote
mirror
,
Remote
mirror
,
$core
.
Iterable
<
Cherrypick
>
cherrypicks
,
$core
.
Iterable
<
Cherrypick
>
cherrypicks
,
$core
.
String
dartRevision
,
})
{
})
{
final
_result
=
create
();
final
_result
=
create
();
if
(
candidateBranch
!=
null
)
{
if
(
candidateBranch
!=
null
)
{
...
@@ -239,9 +236,6 @@ class Repository extends $pb.GeneratedMessage {
...
@@ -239,9 +236,6 @@ class Repository extends $pb.GeneratedMessage {
if
(
cherrypicks
!=
null
)
{
if
(
cherrypicks
!=
null
)
{
_result
.
cherrypicks
.
addAll
(
cherrypicks
);
_result
.
cherrypicks
.
addAll
(
cherrypicks
);
}
}
if
(
dartRevision
!=
null
)
{
_result
.
dartRevision
=
dartRevision
;
}
return
_result
;
return
_result
;
}
}
factory
Repository
.
fromBuffer
(
$core
.
List
<
$core
.
int
>
i
,
[
$pb
.
ExtensionRegistry
r
=
$pb
.
ExtensionRegistry
.
EMPTY
])
=>
factory
Repository
.
fromBuffer
(
$core
.
List
<
$core
.
int
>
i
,
[
$pb
.
ExtensionRegistry
r
=
$pb
.
ExtensionRegistry
.
EMPTY
])
=>
...
@@ -344,18 +338,6 @@ class Repository extends $pb.GeneratedMessage {
...
@@ -344,18 +338,6 @@ class Repository extends $pb.GeneratedMessage {
@
$pb
.
TagNumber
(
7
)
@
$pb
.
TagNumber
(
7
)
$core
.
List
<
Cherrypick
>
get
cherrypicks
=>
$_getList
(
6
);
$core
.
List
<
Cherrypick
>
get
cherrypicks
=>
$_getList
(
6
);
@
$pb
.
TagNumber
(
8
)
$core
.
String
get
dartRevision
=>
$_getSZ
(
7
);
@
$pb
.
TagNumber
(
8
)
set
dartRevision
(
$core
.
String
v
)
{
$_setString
(
7
,
v
);
}
@
$pb
.
TagNumber
(
8
)
$core
.
bool
hasDartRevision
()
=>
$_has
(
7
);
@
$pb
.
TagNumber
(
8
)
void
clearDartRevision
()
=>
clearField
(
8
);
}
}
class
ConductorState
extends
$pb
.
GeneratedMessage
{
class
ConductorState
extends
$pb
.
GeneratedMessage
{
...
...
dev/tools/lib/proto/conductor_state.pbjson.dart
View file @
843083c9
...
@@ -80,13 +80,12 @@ const Repository$json = const {
...
@@ -80,13 +80,12 @@ const Repository$json = const {
const
{
'1'
:
'upstream'
,
'3'
:
5
,
'4'
:
1
,
'5'
:
11
,
'6'
:
'.conductor_state.Remote'
,
'10'
:
'upstream'
},
const
{
'1'
:
'upstream'
,
'3'
:
5
,
'4'
:
1
,
'5'
:
11
,
'6'
:
'.conductor_state.Remote'
,
'10'
:
'upstream'
},
const
{
'1'
:
'mirror'
,
'3'
:
6
,
'4'
:
1
,
'5'
:
11
,
'6'
:
'.conductor_state.Remote'
,
'10'
:
'mirror'
},
const
{
'1'
:
'mirror'
,
'3'
:
6
,
'4'
:
1
,
'5'
:
11
,
'6'
:
'.conductor_state.Remote'
,
'10'
:
'mirror'
},
const
{
'1'
:
'cherrypicks'
,
'3'
:
7
,
'4'
:
3
,
'5'
:
11
,
'6'
:
'.conductor_state.Cherrypick'
,
'10'
:
'cherrypicks'
},
const
{
'1'
:
'cherrypicks'
,
'3'
:
7
,
'4'
:
3
,
'5'
:
11
,
'6'
:
'.conductor_state.Cherrypick'
,
'10'
:
'cherrypicks'
},
const
{
'1'
:
'dartRevision'
,
'3'
:
8
,
'4'
:
1
,
'5'
:
9
,
'10'
:
'dartRevision'
},
],
],
};
};
/// Descriptor for `Repository`. Decode as a `google.protobuf.DescriptorProto`.
/// Descriptor for `Repository`. Decode as a `google.protobuf.DescriptorProto`.
final
$typed_data
.
Uint8List
repositoryDescriptor
=
$convert
.
base64Decode
(
final
$typed_data
.
Uint8List
repositoryDescriptor
=
$convert
.
base64Decode
(
'CgpSZXBvc2l0b3J5EigKD2NhbmRpZGF0ZUJyYW5jaBgBIAEoCVIPY2FuZGlkYXRlQnJhbmNoEigKD3N0YXJ0aW5nR2l0SGVhZBgCIAEoCVIPc3RhcnRpbmdHaXRIZWFkEiYKDmN1cnJlbnRHaXRIZWFkGAMgASgJUg5jdXJyZW50R2l0SGVhZBIiCgxjaGVja291dFBhdGgYBCABKAlSDGNoZWNrb3V0UGF0aBIzCgh1cHN0cmVhbRgFIAEoCzIXLmNvbmR1Y3Rvcl9zdGF0ZS5SZW1vdGVSCHVwc3RyZWFtEi8KBm1pcnJvchgGIAEoCzIXLmNvbmR1Y3Rvcl9zdGF0ZS5SZW1vdGVSBm1pcnJvchI9CgtjaGVycnlwaWNrcxgHIAMoCzIbLmNvbmR1Y3Rvcl9zdGF0ZS5DaGVycnlwaWNrUgtjaGVycnlwaWNrc
xIiCgxkYXJ0UmV2aXNpb24YCCABKAlSDGRhcnRSZXZpc2lvbg
=='
);
'CgpSZXBvc2l0b3J5EigKD2NhbmRpZGF0ZUJyYW5jaBgBIAEoCVIPY2FuZGlkYXRlQnJhbmNoEigKD3N0YXJ0aW5nR2l0SGVhZBgCIAEoCVIPc3RhcnRpbmdHaXRIZWFkEiYKDmN1cnJlbnRHaXRIZWFkGAMgASgJUg5jdXJyZW50R2l0SGVhZBIiCgxjaGVja291dFBhdGgYBCABKAlSDGNoZWNrb3V0UGF0aBIzCgh1cHN0cmVhbRgFIAEoCzIXLmNvbmR1Y3Rvcl9zdGF0ZS5SZW1vdGVSCHVwc3RyZWFtEi8KBm1pcnJvchgGIAEoCzIXLmNvbmR1Y3Rvcl9zdGF0ZS5SZW1vdGVSBm1pcnJvchI9CgtjaGVycnlwaWNrcxgHIAMoCzIbLmNvbmR1Y3Rvcl9zdGF0ZS5DaGVycnlwaWNrUgtjaGVycnlwaWNrc
w
=='
);
@
$core
.
Deprecated
(
'Use conductorStateDescriptor instead'
)
@
$core
.
Deprecated
(
'Use conductorStateDescriptor instead'
)
const
ConductorState$json
=
const
{
const
ConductorState$json
=
const
{
'1'
:
'ConductorState'
,
'1'
:
'ConductorState'
,
...
...
dev/tools/lib/proto/conductor_state.proto
View file @
843083c9
...
@@ -79,9 +79,6 @@ message Repository {
...
@@ -79,9 +79,6 @@ message Repository {
// Desired cherrypicks.
// Desired cherrypicks.
repeated
Cherrypick
cherrypicks
=
7
;
repeated
Cherrypick
cherrypicks
=
7
;
// Only for engine repositories.
string
dartRevision
=
8
;
}
}
message
ConductorState
{
message
ConductorState
{
...
...
dev/tools/lib/repository.dart
View file @
843083c9
...
@@ -365,26 +365,6 @@ abstract class Repository {
...
@@ -365,26 +365,6 @@ abstract class Repository {
);
);
}
}
String
commit
(
String
message
,
{
bool
addFirst
=
false
,
})
{
assert
(!
message
.
contains
(
"'"
));
if
(
addFirst
)
{
git
.
run
(
<
String
>[
'add'
,
'--all'
],
'add all changes to the index'
,
workingDirectory:
checkoutDirectory
.
path
,
);
}
git
.
run
(
<
String
>[
'commit'
,
'--message=
\'
$message
\'
'
],
'commit changes'
,
workingDirectory:
checkoutDirectory
.
path
,
);
return
reverseParse
(
'HEAD'
);
}
/// Create an empty commit and return the revision.
/// Create an empty commit and return the revision.
@visibleForTesting
@visibleForTesting
String
authorEmptyCommit
([
String
message
=
'An empty commit'
])
{
String
authorEmptyCommit
([
String
message
=
'An empty commit'
])
{
...
@@ -637,31 +617,6 @@ class EngineRepository extends Repository {
...
@@ -637,31 +617,6 @@ class EngineRepository extends Repository {
static
const
String
defaultUpstream
=
'https://github.com/flutter/engine.git'
;
static
const
String
defaultUpstream
=
'https://github.com/flutter/engine.git'
;
static
const
String
defaultBranch
=
'master'
;
static
const
String
defaultBranch
=
'master'
;
/// Update the `dart_revision` entry in the DEPS file.
void
updateDartRevision
(
String
newRevision
,
{
@visibleForTesting
File
?
depsFile
,
})
{
assert
(
newRevision
.
length
==
40
);
depsFile
??=
checkoutDirectory
.
childFile
(
'DEPS'
);
final
String
fileContent
=
depsFile
.
readAsStringSync
();
final
RegExp
dartPattern
=
RegExp
(
'[ ]+
\'
dart_revision
\'
:
\'
([a-z0-9]{40})
\'
,'
);
final
Iterable
<
RegExpMatch
>
allMatches
=
dartPattern
.
allMatches
(
fileContent
);
if
(
allMatches
.
length
!=
1
)
{
throw
ConductorException
(
'Unexpected content in the DEPS file at
${depsFile.path}
\n
'
'Expected to find pattern
${dartPattern.pattern}
1 times, but got '
'
${allMatches.length}
.'
);
}
final
String
updatedFileContent
=
fileContent
.
replaceFirst
(
dartPattern
,
'
\'
dart_revision
\'
:
\'
$newRevision
\'
,'
,
);
depsFile
.
writeAsStringSync
(
updatedFileContent
);
}
@override
@override
Repository
cloneRepository
(
String
?
cloneName
)
{
Repository
cloneRepository
(
String
?
cloneName
)
{
assert
(
localUpstream
);
assert
(
localUpstream
);
...
...
dev/tools/lib/start.dart
View file @
843083c9
...
@@ -22,15 +22,14 @@ import './state.dart';
...
@@ -22,15 +22,14 @@ import './state.dart';
import
'./stdio.dart'
;
import
'./stdio.dart'
;
const
String
kCandidateOption
=
'candidate-branch'
;
const
String
kCandidateOption
=
'candidate-branch'
;
const
String
kDartRevisionOption
=
'dart-revision'
;
const
String
kEngineCherrypicksOption
=
'engine-cherrypicks'
;
const
String
kEngineUpstreamOption
=
'engine-upstream'
;
const
String
kFrameworkCherrypicksOption
=
'framework-cherrypicks'
;
const
String
kFrameworkMirrorOption
=
'framework-mirror'
;
const
String
kFrameworkUpstreamOption
=
'framework-upstream'
;
const
String
kEngineMirrorOption
=
'engine-mirror'
;
const
String
kReleaseOption
=
'release-channel'
;
const
String
kReleaseOption
=
'release-channel'
;
const
String
kStateOption
=
'state-file'
;
const
String
kStateOption
=
'state-file'
;
const
String
kFrameworkMirrorOption
=
'framework-mirror'
;
const
String
kEngineMirrorOption
=
'engine-mirror'
;
const
String
kFrameworkUpstreamOption
=
'framework-upstream'
;
const
String
kEngineUpstreamOption
=
'engine-upstream'
;
const
String
kFrameworkCherrypicksOption
=
'framework-cherrypicks'
;
const
String
kEngineCherrypicksOption
=
'engine-cherrypicks'
;
/// Command to print the status of the current Flutter release.
/// Command to print the status of the current Flutter release.
class
StartCommand
extends
Command
<
void
>
{
class
StartCommand
extends
Command
<
void
>
{
...
@@ -87,10 +86,6 @@ class StartCommand extends Command<void> {
...
@@ -87,10 +86,6 @@ class StartCommand extends Command<void> {
help:
'Framework cherrypick hashes to be applied.'
,
help:
'Framework cherrypick hashes to be applied.'
,
defaultsTo:
<
String
>[],
defaultsTo:
<
String
>[],
);
);
argParser
.
addOption
(
kDartRevisionOption
,
help:
'New Dart revision to cherrypick.'
,
);
final
Git
git
=
Git
(
processManager
);
final
Git
git
=
Git
(
processManager
);
conductorVersion
=
git
.
getOutput
(
conductorVersion
=
git
.
getOutput
(
<
String
>[
'rev-parse'
,
'HEAD'
],
<
String
>[
'rev-parse'
,
'HEAD'
],
...
@@ -177,17 +172,10 @@ class StartCommand extends Command<void> {
...
@@ -177,17 +172,10 @@ class StartCommand extends Command<void> {
argResults
,
argResults
,
platform
.
environment
,
platform
.
environment
,
);
);
final
String
dartRevision
=
getValueFromEnvOrArgs
(
kDartRevisionOption
,
argResults
,
platform
.
environment
,
allowNull:
true
,
);
if
(!
releaseCandidateBranchRegex
.
hasMatch
(
candidateBranch
))
{
if
(!
releaseCandidateBranchRegex
.
hasMatch
(
candidateBranch
))
{
throw
ConductorException
(
throw
ConductorException
(
'Invalid release candidate branch "
$candidateBranch
". Text should '
'Invalid release candidate branch "
$candidateBranch
". '
'match the regex pattern /
${releaseCandidateBranchRegex.pattern}
/.'
,
'Text should match the regex pattern /
${releaseCandidateBranchRegex.pattern}
/.'
);
);
}
}
final
Int64
unixDate
=
Int64
(
DateTime
.
now
().
millisecondsSinceEpoch
);
final
Int64
unixDate
=
Int64
(
DateTime
.
now
().
millisecondsSinceEpoch
);
...
@@ -209,15 +197,9 @@ class StartCommand extends Command<void> {
...
@@ -209,15 +197,9 @@ class StartCommand extends Command<void> {
url:
engineMirror
,
url:
engineMirror
,
),
),
);
);
// Create a new branch so that we don't accidentally push to upstream
// Create a new branch so that we don't accidentally push to upstream
// candidateBranch.
// candidateBranch.
engine
.
newBranch
(
'cherrypicks-
$candidateBranch
'
);
engine
.
newBranch
(
'cherrypicks-
$candidateBranch
'
);
if
(
dartRevision
!=
null
&&
dartRevision
.
isNotEmpty
)
{
engine
.
updateDartRevision
(
dartRevision
);
engine
.
commit
(
'Update Dart SDK to
$dartRevision
'
,
addFirst:
true
);
}
final
List
<
pb
.
Cherrypick
>
engineCherrypicks
=
_sortCherrypicks
(
final
List
<
pb
.
Cherrypick
>
engineCherrypicks
=
_sortCherrypicks
(
repository:
engine
,
repository:
engine
,
cherrypicks:
engineCherrypickRevisions
,
cherrypicks:
engineCherrypickRevisions
,
...
@@ -248,7 +230,6 @@ class StartCommand extends Command<void> {
...
@@ -248,7 +230,6 @@ class StartCommand extends Command<void> {
currentGitHead:
engineHead
,
currentGitHead:
engineHead
,
checkoutPath:
engine
.
checkoutDirectory
.
path
,
checkoutPath:
engine
.
checkoutDirectory
.
path
,
cherrypicks:
engineCherrypicks
,
cherrypicks:
engineCherrypicks
,
dartRevision:
dartRevision
,
);
);
final
FrameworkRepository
framework
=
FrameworkRepository
(
final
FrameworkRepository
framework
=
FrameworkRepository
(
checkouts
,
checkouts
,
...
...
dev/tools/lib/state.dart
View file @
843083c9
...
@@ -57,9 +57,6 @@ String presentState(pb.ConductorState state) {
...
@@ -57,9 +57,6 @@ String presentState(pb.ConductorState state) {
}
else
{
}
else
{
buffer
.
writeln
(
'0 Engine cherrypicks.'
);
buffer
.
writeln
(
'0 Engine cherrypicks.'
);
}
}
if
(
state
.
engine
.
dartRevision
!=
null
&&
state
.
engine
.
dartRevision
.
isNotEmpty
)
{
buffer
.
writeln
(
'New Dart SDK revision:
${state.engine.dartRevision}
'
);
}
buffer
.
writeln
(
'Framework Repo'
);
buffer
.
writeln
(
'Framework Repo'
);
buffer
.
writeln
(
'
\t
Candidate branch:
${state.framework.candidateBranch}
'
);
buffer
.
writeln
(
'
\t
Candidate branch:
${state.framework.candidateBranch}
'
);
buffer
.
writeln
(
'
\t
Starting git HEAD:
${state.framework.startingGitHead}
'
);
buffer
.
writeln
(
'
\t
Starting git HEAD:
${state.framework.startingGitHead}
'
);
...
...
dev/tools/test/repository_test.dart
View file @
843083c9
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
// found in the LICENSE file.
// found in the LICENSE file.
import
'package:dev_tools/repository.dart'
;
import
'package:dev_tools/repository.dart'
;
import
'package:file/file.dart'
;
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:platform/platform.dart'
;
import
'package:platform/platform.dart'
;
...
@@ -13,20 +12,9 @@ import './common.dart';
...
@@ -13,20 +12,9 @@ import './common.dart';
void
main
(
)
{
void
main
(
)
{
group
(
'repository'
,
()
{
group
(
'repository'
,
()
{
late
FakePlatform
platform
;
const
String
rootDir
=
'/'
;
setUp
(()
{
final
String
pathSeparator
=
const
LocalPlatform
().
pathSeparator
;
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
'HOME'
:
<
String
>[
'path'
,
'to'
,
'home'
].
join
(
pathSeparator
),
},
pathSeparator:
pathSeparator
,
);
});
test
(
'canCherryPick returns true if git cherry-pick returns 0'
,
()
{
test
(
'canCherryPick returns true if git cherry-pick returns 0'
,
()
{
const
LocalPlatform
platform
=
LocalPlatform
();
const
String
rootDir
=
'/'
;
const
String
commit
=
'abc123'
;
const
String
commit
=
'abc123'
;
final
TestStdio
stdio
=
TestStdio
();
final
TestStdio
stdio
=
TestStdio
();
...
@@ -78,6 +66,8 @@ void main() {
...
@@ -78,6 +66,8 @@ void main() {
});
});
test
(
'canCherryPick returns false if git cherry-pick returns non-zero'
,
()
{
test
(
'canCherryPick returns false if git cherry-pick returns non-zero'
,
()
{
const
LocalPlatform
platform
=
LocalPlatform
();
const
String
rootDir
=
'/'
;
const
String
commit
=
'abc123'
;
const
String
commit
=
'abc123'
;
final
TestStdio
stdio
=
TestStdio
();
final
TestStdio
stdio
=
TestStdio
();
...
@@ -133,6 +123,8 @@ void main() {
...
@@ -133,6 +123,8 @@ void main() {
});
});
test
(
'cherryPick() applies the commit'
,
()
{
test
(
'cherryPick() applies the commit'
,
()
{
const
LocalPlatform
platform
=
LocalPlatform
();
const
String
rootDir
=
'/'
;
const
String
commit
=
'abc123'
;
const
String
commit
=
'abc123'
;
final
TestStdio
stdio
=
TestStdio
();
final
TestStdio
stdio
=
TestStdio
();
...
@@ -176,122 +168,5 @@ void main() {
...
@@ -176,122 +168,5 @@ void main() {
repository
.
cherryPick
(
commit
);
repository
.
cherryPick
(
commit
);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
});
});
test
(
'updateDartRevision() updates the DEPS file'
,
()
{
const
String
previousDartRevision
=
'171876a4e6cf56ee6da1f97d203926bd7afda7ef'
;
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
final
TestStdio
stdio
=
TestStdio
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FakeProcessManager
processManager
=
FakeProcessManager
.
empty
();
final
Checkouts
checkouts
=
Checkouts
(
fileSystem:
fileSystem
,
parentDirectory:
fileSystem
.
directory
(
rootDir
),
platform:
platform
,
processManager:
processManager
,
stdio:
stdio
,
);
final
EngineRepository
repo
=
EngineRepository
(
checkouts
);
final
File
depsFile
=
fileSystem
.
file
(
'/DEPS'
);
depsFile
.
writeAsStringSync
(
generateMockDeps
(
previousDartRevision
));
repo
.
updateDartRevision
(
nextDartRevision
,
depsFile:
depsFile
);
final
String
updatedDepsFileContent
=
depsFile
.
readAsStringSync
();
expect
(
updatedDepsFileContent
,
generateMockDeps
(
nextDartRevision
));
});
test
(
'updateDartRevision() throws exception on malformed DEPS file'
,
()
{
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
final
TestStdio
stdio
=
TestStdio
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FakeProcessManager
processManager
=
FakeProcessManager
.
empty
();
final
Checkouts
checkouts
=
Checkouts
(
fileSystem:
fileSystem
,
parentDirectory:
fileSystem
.
directory
(
rootDir
),
platform:
platform
,
processManager:
processManager
,
stdio:
stdio
,
);
final
EngineRepository
repo
=
EngineRepository
(
checkouts
);
final
File
depsFile
=
fileSystem
.
file
(
'/DEPS'
);
depsFile
.
writeAsStringSync
(
'''
vars = {
}'''
);
expect
(
()
=>
repo
.
updateDartRevision
(
nextDartRevision
,
depsFile:
depsFile
),
throwsExceptionWith
(
'Unexpected content in the DEPS file at'
),
);
});
test
(
'commit() passes correct commit message'
,
()
{
const
String
commit1
=
'abc123'
;
const
String
commit2
=
'def456'
;
const
String
message
=
'This is a commit message.'
;
final
TestStdio
stdio
=
TestStdio
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
'git'
,
'clone'
,
'--origin'
,
'upstream'
,
'--'
,
EngineRepository
.
defaultUpstream
,
fileSystem
.
path
.
join
(
rootDir
,
'flutter_conductor_checkouts'
,
'engine'
),
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
'upstream/master'
,
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
,
],
stdout:
commit1
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'commit'
,
"--message='
$message
'"
,
]),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
,
],
stdout:
commit2
),
]);
final
Checkouts
checkouts
=
Checkouts
(
fileSystem:
fileSystem
,
parentDirectory:
fileSystem
.
directory
(
rootDir
),
platform:
platform
,
processManager:
processManager
,
stdio:
stdio
,
);
final
EngineRepository
repo
=
EngineRepository
(
checkouts
);
repo
.
commit
(
message
);
});
});
});
}
}
String
generateMockDeps
(
String
dartRevision
)
{
return
'''
vars = {
'
chromium_git
': '
https:
//chromium.googlesource.com',
'swiftshader_git'
:
'https://swiftshader.googlesource.com'
,
'dart_git'
:
'https://dart.googlesource.com'
,
'flutter_git'
:
'https://flutter.googlesource.com'
,
'fuchsia_git'
:
'https://fuchsia.googlesource.com'
,
'github_git'
:
'https://github.com'
,
'skia_git'
:
'https://skia.googlesource.com'
,
'ocmock_git'
:
'https://github.com/erikdoe/ocmock.git'
,
'skia_revision'
:
'4e9d5e2bdf04c58bc0bff57be7171e469e5d7175'
,
'dart_revision'
:
'
$dartRevision
'
,
'dart_boringssl_gen_rev'
:
'7322fc15cc065d8d2957fccce6b62a509dc4d641'
,
}
''';
}
dev/tools/test/start_test.dart
View file @
843083c9
...
@@ -120,14 +120,6 @@ void main() {
...
@@ -120,14 +120,6 @@ void main() {
test
(
'creates state file if provided correct inputs'
,
()
async
{
test
(
'creates state file if provided correct inputs'
,
()
async
{
const
String
revision2
=
'def789'
;
const
String
revision2
=
'def789'
;
const
String
revision3
=
'123abc'
;
const
String
revision3
=
'123abc'
;
const
String
previousDartRevision
=
'171876a4e6cf56ee6da1f97d203926bd7afda7ef'
;
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
final
Directory
engine
=
fileSystem
.
directory
(
checkoutsParentDirectory
)
.
childDirectory
(
'flutter_conductor_checkouts'
)
.
childDirectory
(
'engine'
);
final
File
depsFile
=
engine
.
childFile
(
'DEPS'
);
final
List
<
FakeCommand
>
engineCommands
=
<
FakeCommand
>[
final
List
<
FakeCommand
>
engineCommands
=
<
FakeCommand
>[
FakeCommand
(
FakeCommand
(
...
@@ -138,13 +130,12 @@ void main() {
...
@@ -138,13 +130,12 @@ void main() {
'upstream'
,
'upstream'
,
'--'
,
'--'
,
EngineRepository
.
defaultUpstream
,
EngineRepository
.
defaultUpstream
,
engine
.
path
,
fileSystem
.
path
.
join
(
checkoutsParentDirectory
,
'flutter_conductor_checkouts'
,
'engine'
,
),
],
],
onRun:
()
{
// Create the DEPS file which the tool will update
engine
.
createSync
(
recursive:
true
);
depsFile
.
writeAsStringSync
(
generateMockDeps
(
previousDartRevision
));
}
),
),
const
FakeCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'remote'
,
'add'
,
'mirror'
,
engineMirror
],
command:
<
String
>[
'git'
,
'remote'
,
'add'
,
'mirror'
,
engineMirror
],
...
@@ -167,16 +158,6 @@ void main() {
...
@@ -167,16 +158,6 @@ void main() {
'cherrypicks-
$candidateBranch
'
,
'cherrypicks-
$candidateBranch
'
,
],
],
),
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'add'
,
'--all'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'commit'
,
"--message='Update Dart SDK to
$nextDartRevision
'"
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision2
,
),
const
FakeCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision2
,
stdout:
revision2
,
...
@@ -252,8 +233,6 @@ void main() {
...
@@ -252,8 +233,6 @@ void main() {
releaseChannel
,
releaseChannel
,
'--
$kStateOption
'
,
'--
$kStateOption
'
,
stateFilePath
,
stateFilePath
,
'--
$kDartRevisionOption
'
,
nextDartRevision
,
]);
]);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
...
@@ -267,7 +246,6 @@ void main() {
...
@@ -267,7 +246,6 @@ void main() {
expect
(
state
.
releaseChannel
,
releaseChannel
);
expect
(
state
.
releaseChannel
,
releaseChannel
);
expect
(
state
.
engine
.
candidateBranch
,
candidateBranch
);
expect
(
state
.
engine
.
candidateBranch
,
candidateBranch
);
expect
(
state
.
engine
.
startingGitHead
,
revision2
);
expect
(
state
.
engine
.
startingGitHead
,
revision2
);
expect
(
state
.
engine
.
dartRevision
,
nextDartRevision
);
expect
(
state
.
framework
.
candidateBranch
,
candidateBranch
);
expect
(
state
.
framework
.
candidateBranch
,
candidateBranch
);
expect
(
state
.
framework
.
startingGitHead
,
revision3
);
expect
(
state
.
framework
.
startingGitHead
,
revision3
);
expect
(
state
.
lastPhase
,
ReleasePhase
.
INITIALIZE
);
expect
(
state
.
lastPhase
,
ReleasePhase
.
INITIALIZE
);
...
@@ -277,21 +255,3 @@ void main() {
...
@@ -277,21 +255,3 @@ void main() {
'windows'
:
const
Skip
(
'Flutter Conductor only supported on macos/linux'
),
'windows'
:
const
Skip
(
'Flutter Conductor only supported on macos/linux'
),
});
});
}
}
String
generateMockDeps
(
String
dartRevision
)
{
return
'''
vars = {
'
chromium_git
': '
https:
//chromium.googlesource.com',
'swiftshader_git'
:
'https://swiftshader.googlesource.com'
,
'dart_git'
:
'https://dart.googlesource.com'
,
'flutter_git'
:
'https://flutter.googlesource.com'
,
'fuchsia_git'
:
'https://fuchsia.googlesource.com'
,
'github_git'
:
'https://github.com'
,
'skia_git'
:
'https://skia.googlesource.com'
,
'ocmock_git'
:
'https://github.com/erikdoe/ocmock.git'
,
'skia_revision'
:
'4e9d5e2bdf04c58bc0bff57be7171e469e5d7175'
,
'dart_revision'
:
'
$dartRevision
'
,
'dart_boringssl_gen_rev'
:
'7322fc15cc065d8d2957fccce6b62a509dc4d641'
,
}
''';
}
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