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
2edf6b73
Unverified
Commit
2edf6b73
authored
Mar 11, 2021
by
Jonah Williams
Committed by
GitHub
Mar 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove mockito deps from dev/ (#77749)
parent
5baebb88
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
394 deletions
+86
-394
pubspec.yaml
dev/bots/pubspec.yaml
+1
-2
fake_process_manager.dart
dev/bots/test/fake_process_manager.dart
+0
-188
fake_process_manager_test.dart
dev/bots/test/fake_process_manager_test.dart
+0
-108
prepare_package_test.dart
dev/bots/test/prepare_package_test.dart
+51
-33
test_test.dart
dev/bots/test/test_test.dart
+12
-10
pubspec.yaml
dev/integration_tests/flutter_gallery/pubspec.yaml
+2
-2
pubspec.yaml
dev/tools/pubspec.yaml
+20
-51
No files found.
dev/bots/pubspec.yaml
View file @
2edf6b73
...
...
@@ -61,7 +61,6 @@ dependencies:
yaml
:
3.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies
:
mockito
:
4.1.1
test_api
:
0.2.19
# PUBSPEC CHECKSUM: 1
856
# PUBSPEC CHECKSUM: 1
c10
dev/bots/test/fake_process_manager.dart
deleted
100644 → 0
View file @
5baebb88
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:io'
;
import
'package:process/process.dart'
;
import
'package:mockito/mockito.dart'
;
import
'common.dart'
;
/// A mock that can be used to fake a process manager that runs commands
/// and returns results.
///
/// Call [setResults] to provide a list of results that will return from
/// each command line (with arguments).
///
/// Call [verifyCalls] to verify that each desired call occurred.
class
FakeProcessManager
extends
Mock
implements
ProcessManager
{
FakeProcessManager
({
this
.
stdinResults
})
{
_setupMock
();
}
/// The callback that will be called each time stdin input is supplied to
/// a call.
final
StringReceivedCallback
stdinResults
;
/// The list of results that will be sent back, organized by the command line
/// that will produce them. Each command line has a list of returned stdout
/// output that will be returned on each successive call.
Map
<
String
,
List
<
ProcessResult
>>
_fakeResults
=
<
String
,
List
<
ProcessResult
>>{};
Map
<
String
,
List
<
ProcessResult
>>
get
fakeResults
=>
_fakeResults
;
set
fakeResults
(
Map
<
String
,
List
<
ProcessResult
>>
value
)
{
_fakeResults
=
<
String
,
List
<
ProcessResult
>>{};
for
(
final
String
key
in
value
.
keys
)
{
_fakeResults
[
key
]
=
(
value
[
key
]
??
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
''
,
''
)]).
toList
();
}
}
/// The list of invocations that occurred, in the order they occurred.
List
<
Invocation
>
invocations
=
<
Invocation
>[];
/// Verify that the given command lines were called, in the given order, and that the
/// parameters were in the same order.
void
verifyCalls
(
List
<
String
>
calls
)
{
int
index
=
0
;
for
(
final
String
call
in
calls
)
{
expect
(
call
.
split
(
' '
),
orderedEquals
(
invocations
[
index
].
positionalArguments
[
0
]
as
Iterable
<
dynamic
>));
index
++;
}
expect
(
invocations
.
length
,
equals
(
calls
.
length
));
}
ProcessResult
_popResult
(
List
<
String
>
command
)
{
final
String
key
=
command
.
join
(
' '
);
expect
(
fakeResults
,
contains
(
key
));
expect
(
fakeResults
[
key
],
isNotEmpty
);
return
fakeResults
[
key
].
removeAt
(
0
);
}
FakeProcess
_popProcess
(
List
<
String
>
command
)
=>
FakeProcess
(
_popResult
(
command
),
stdinResults:
stdinResults
);
Future
<
Process
>
_nextProcess
(
Invocation
invocation
)
async
{
invocations
.
add
(
invocation
);
return
Future
<
Process
>.
value
(
_popProcess
(
invocation
.
positionalArguments
[
0
]
as
List
<
String
>));
}
ProcessResult
_nextResultSync
(
Invocation
invocation
)
{
invocations
.
add
(
invocation
);
return
_popResult
(
invocation
.
positionalArguments
[
0
]
as
List
<
String
>);
}
Future
<
ProcessResult
>
_nextResult
(
Invocation
invocation
)
async
{
invocations
.
add
(
invocation
);
return
Future
<
ProcessResult
>.
value
(
_popResult
(
invocation
.
positionalArguments
[
0
]
as
List
<
String
>));
}
void
_setupMock
()
{
// Not all possible types of invocations are covered here, just the ones
// expected to be called.
// TODO(gspencer): make this more general so that any call will be captured.
when
(
start
(
any
,
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
(
_nextProcess
);
when
(
start
(
any
)).
thenAnswer
(
_nextProcess
);
when
(
run
(
any
,
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
(
_nextResult
);
when
(
run
(
any
)).
thenAnswer
(
_nextResult
);
when
(
runSync
(
any
,
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
(
_nextResultSync
);
when
(
runSync
(
any
)).
thenAnswer
(
_nextResultSync
);
when
(
killPid
(
any
,
any
)).
thenReturn
(
true
);
when
(
canRun
(
any
,
workingDirectory:
anyNamed
(
'workingDirectory'
)))
.
thenReturn
(
true
);
}
}
/// A fake process that can be used to interact with a process "started" by the FakeProcessManager.
class
FakeProcess
extends
Mock
implements
Process
{
FakeProcess
(
ProcessResult
result
,
{
void
Function
(
String
input
)
stdinResults
})
:
stdoutStream
=
Stream
<
List
<
int
>>.
value
((
result
.
stdout
as
String
).
codeUnits
),
stderrStream
=
Stream
<
List
<
int
>>.
value
((
result
.
stderr
as
String
).
codeUnits
),
desiredExitCode
=
result
.
exitCode
,
stdinSink
=
IOSink
(
StringStreamConsumer
(
stdinResults
))
{
_setupMock
();
}
final
IOSink
stdinSink
;
final
Stream
<
List
<
int
>>
stdoutStream
;
final
Stream
<
List
<
int
>>
stderrStream
;
final
int
desiredExitCode
;
void
_setupMock
()
{
when
(
kill
(
any
)).
thenReturn
(
true
);
}
@override
Future
<
int
>
get
exitCode
=>
Future
<
int
>.
value
(
desiredExitCode
);
@override
int
get
pid
=>
0
;
@override
IOSink
get
stdin
=>
stdinSink
;
@override
Stream
<
List
<
int
>>
get
stderr
=>
stderrStream
;
@override
Stream
<
List
<
int
>>
get
stdout
=>
stdoutStream
;
}
/// Callback used to receive stdin input when it occurs.
typedef
StringReceivedCallback
=
void
Function
(
String
received
);
/// A stream consumer class that consumes UTF8 strings as lists of ints.
class
StringStreamConsumer
implements
StreamConsumer
<
List
<
int
>>
{
StringStreamConsumer
(
this
.
sendString
);
List
<
Stream
<
List
<
int
>>>
streams
=
<
Stream
<
List
<
int
>>>[];
List
<
StreamSubscription
<
List
<
int
>>>
subscriptions
=
<
StreamSubscription
<
List
<
int
>>>[];
List
<
Completer
<
dynamic
>>
completers
=
<
Completer
<
dynamic
>>[];
/// The callback called when this consumer receives input.
StringReceivedCallback
sendString
;
@override
Future
<
dynamic
>
addStream
(
Stream
<
List
<
int
>>
value
)
{
streams
.
add
(
value
);
completers
.
add
(
Completer
<
dynamic
>());
subscriptions
.
add
(
value
.
listen
((
List
<
int
>
data
)
{
sendString
(
utf8
.
decode
(
data
));
}),
);
subscriptions
.
last
.
onDone
(()
=>
completers
.
last
.
complete
(
null
));
return
Future
<
dynamic
>.
value
(
null
);
}
@override
Future
<
dynamic
>
close
()
async
{
for
(
final
Completer
<
dynamic
>
completer
in
completers
)
{
await
completer
.
future
;
}
completers
.
clear
();
streams
.
clear
();
subscriptions
.
clear
();
return
Future
<
dynamic
>.
value
(
null
);
}
}
dev/bots/test/fake_process_manager_test.dart
deleted
100644 → 0
View file @
5baebb88
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:convert'
;
import
'dart:io'
;
import
'common.dart'
;
import
'fake_process_manager.dart'
;
void
main
(
)
{
group
(
'ArchivePublisher'
,
()
{
FakeProcessManager
processManager
;
final
List
<
String
>
stdinCaptured
=
<
String
>[];
void
_captureStdin
(
String
item
)
{
stdinCaptured
.
add
(
item
);
}
setUp
(()
async
{
processManager
=
FakeProcessManager
(
stdinResults:
_captureStdin
);
});
tearDown
(()
async
{});
test
(
'start works'
,
()
async
{
final
Map
<
String
,
List
<
ProcessResult
>>
calls
=
<
String
,
List
<
ProcessResult
>>{
'gsutil acl get gs://flutter_infra_release/releases/releases.json'
:
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
'output1'
,
''
),
],
'gsutil cat gs://flutter_infra_release/releases/releases.json'
:
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
'output2'
,
''
),
],
};
processManager
.
fakeResults
=
calls
;
for
(
final
String
key
in
calls
.
keys
)
{
final
Process
process
=
await
processManager
.
start
(
key
.
split
(
' '
));
String
output
=
''
;
process
.
stdout
.
listen
((
List
<
int
>
item
)
{
output
+=
utf8
.
decode
(
item
);
});
await
process
.
exitCode
;
expect
(
output
,
equals
(
calls
[
key
][
0
].
stdout
));
}
processManager
.
verifyCalls
(
calls
.
keys
.
toList
());
});
test
(
'run works'
,
()
async
{
final
Map
<
String
,
List
<
ProcessResult
>>
calls
=
<
String
,
List
<
ProcessResult
>>{
'gsutil acl get gs://flutter_infra_release/releases/releases.json'
:
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
'output1'
,
''
),
],
'gsutil cat gs://flutter_infra_release/releases/releases.json'
:
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
'output2'
,
''
),
],
};
processManager
.
fakeResults
=
calls
;
for
(
final
String
key
in
calls
.
keys
)
{
final
ProcessResult
result
=
await
processManager
.
run
(
key
.
split
(
' '
));
expect
(
result
.
stdout
,
equals
(
calls
[
key
][
0
].
stdout
));
}
processManager
.
verifyCalls
(
calls
.
keys
.
toList
());
});
test
(
'runSync works'
,
()
async
{
final
Map
<
String
,
List
<
ProcessResult
>>
calls
=
<
String
,
List
<
ProcessResult
>>{
'gsutil acl get gs://flutter_infra_release/releases/releases.json'
:
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
'output1'
,
''
),
],
'gsutil cat gs://flutter_infra_release/releases/releases.json'
:
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
'output2'
,
''
),
],
};
processManager
.
fakeResults
=
calls
;
for
(
final
String
key
in
calls
.
keys
)
{
final
ProcessResult
result
=
processManager
.
runSync
(
key
.
split
(
' '
));
expect
(
result
.
stdout
,
equals
(
calls
[
key
][
0
].
stdout
));
}
processManager
.
verifyCalls
(
calls
.
keys
.
toList
());
});
test
(
'captures stdin'
,
()
async
{
final
Map
<
String
,
List
<
ProcessResult
>>
calls
=
<
String
,
List
<
ProcessResult
>>{
'gsutil acl get gs://flutter_infra_release/releases/releases.json'
:
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
'output1'
,
''
),
],
'gsutil cat gs://flutter_infra_release/releases/releases.json'
:
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
'output2'
,
''
),
],
};
processManager
.
fakeResults
=
calls
;
for
(
final
String
key
in
calls
.
keys
)
{
final
Process
process
=
await
processManager
.
start
(
key
.
split
(
' '
));
String
output
=
''
;
process
.
stdout
.
listen
((
List
<
int
>
item
)
{
output
+=
utf8
.
decode
(
item
);
});
final
String
testInput
=
'
${calls[key][0].stdout}
input'
;
process
.
stdin
.
add
(
testInput
.
codeUnits
);
await
process
.
exitCode
;
expect
(
output
,
equals
(
calls
[
key
][
0
].
stdout
));
expect
(
stdinCaptured
.
last
,
equals
(
testInput
));
}
processManager
.
verifyCalls
(
calls
.
keys
.
toList
());
});
});
}
dev/bots/test/prepare_package_test.dart
View file @
2edf6b73
...
...
@@ -6,13 +6,12 @@ import 'dart:convert';
import
'dart:io'
hide
Platform
;
import
'dart:typed_data'
;
import
'package:mockito/mockito.dart'
;
import
'package:path/path.dart'
as
path
;
import
'package:platform/platform.dart'
show
FakePlatform
;
import
'../../../packages/flutter_tools/test/src/fake_process_manager.dart'
;
import
'../prepare_package.dart'
;
import
'common.dart'
;
import
'fake_process_manager.dart'
;
void
main
(
)
{
const
String
testRef
=
'deadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
;
...
...
@@ -43,20 +42,27 @@ void main() {
);
group
(
'ProcessRunner for
$platform
'
,
()
{
test
(
'Returns stdout'
,
()
async
{
final
FakeProcessManager
fakeProcessManager
=
FakeProcessManager
();
fakeProcessManager
.
fakeResults
=
<
String
,
List
<
ProcessResult
>>{
'echo test'
:
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
'output'
,
'error'
)],
};
final
FakeProcessManager
fakeProcessManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'echo'
,
'test'
,],
stdout:
'output'
,
stderr:
'error'
,
)
]);
final
ProcessRunner
processRunner
=
ProcessRunner
(
subprocessOutput:
false
,
platform:
platform
,
processManager:
fakeProcessManager
);
final
String
output
=
await
processRunner
.
runProcess
(<
String
>[
'echo'
,
'test'
]);
expect
(
output
,
equals
(
'output'
));
});
test
(
'Throws on process failure'
,
()
async
{
final
FakeProcessManager
fakeProcessManager
=
FakeProcessManager
();
fakeProcessManager
.
fakeResults
=
<
String
,
List
<
ProcessResult
>>{
'echo test'
:
<
ProcessResult
>[
ProcessResult
(
0
,
-
1
,
'output'
,
'error'
)],
};
final
FakeProcessManager
fakeProcessManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'echo'
,
'test'
,],
stdout:
'output'
,
stderr:
'error'
,
exitCode:
-
1
,
)
]);
final
ProcessRunner
processRunner
=
ProcessRunner
(
subprocessOutput:
false
,
platform:
platform
,
processManager:
fakeProcessManager
);
expect
(
...
...
@@ -81,7 +87,7 @@ void main() {
}
setUp
(()
async
{
processManager
=
FakeProcessManager
(
);
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[]
);
args
.
clear
();
namedArgs
.
clear
();
tempDir
=
Directory
.
systemTemp
.
createTempSync
(
'flutter_prepage_package_test.'
);
...
...
@@ -110,7 +116,8 @@ void main() {
final
String
createBase
=
path
.
join
(
tempDir
.
absolute
.
path
,
'create_'
);
final
String
archiveName
=
path
.
join
(
tempDir
.
absolute
.
path
,
'flutter_
${platformName}
_v1.2.3-dev
${platform.isLinux ? '.tar.xz' : '.zip'}
'
);
processManager
.
fakeResults
=
<
String
,
List
<
ProcessResult
>>{
processManager
.
addCommands
(
convertResults
(<
String
,
List
<
ProcessResult
>>{
'git clone -b dev https://chromium.googlesource.com/external/github.com/flutter/flutter'
:
null
,
'git reset --hard
$testRef
'
:
null
,
'git remote set-url origin https://github.com/flutter/flutter.git'
:
null
,
...
...
@@ -129,17 +136,9 @@ void main() {
if
(
platform
.
isWindows
)
'7za a -tzip -mx=9
$archiveName
flutter'
:
null
else
if
(
platform
.
isMacOS
)
'zip -r -9 --symlinks
$archiveName
flutter'
:
null
else
if
(
platform
.
isLinux
)
'tar cJf
$archiveName
flutter'
:
null
,
};
}
))
;
await
creator
.
initializeRepo
();
await
creator
.
createArchive
();
expect
(
verify
(
processManager
.
start
(
captureAny
,
workingDirectory:
captureAnyNamed
(
'workingDirectory'
),
environment:
captureAnyNamed
(
'environment'
),
)).
captured
[
2
][
'PUB_CACHE'
],
endsWith
(
path
.
join
(
'flutter'
,
'.pub-cache'
)),
);
});
test
(
'calls the right commands for archive output'
,
()
async
{
...
...
@@ -166,7 +165,7 @@ void main() {
else
if
(
platform
.
isMacOS
)
'zip -r -9 --symlinks
$archiveName
flutter'
:
null
else
if
(
platform
.
isLinux
)
'tar cJf
$archiveName
flutter'
:
null
,
};
processManager
.
fakeResults
=
calls
;
processManager
.
addCommands
(
convertResults
(
calls
))
;
creator
=
ArchiveCreator
(
tempDir
,
tempDir
,
...
...
@@ -179,7 +178,6 @@ void main() {
);
await
creator
.
initializeRepo
();
await
creator
.
createArchive
();
processManager
.
verifyCalls
(
calls
.
keys
.
toList
());
});
test
(
'throws when a command errors out'
,
()
async
{
...
...
@@ -188,7 +186,7 @@ void main() {
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
'output1'
,
''
)],
'git reset --hard
$testRef
'
:
<
ProcessResult
>[
ProcessResult
(
0
,
-
1
,
'output2'
,
''
)],
};
processManager
.
fakeResults
=
calls
;
processManager
.
addCommands
(
convertResults
(
calls
))
;
expect
(
expectAsync0
(
creator
.
initializeRepo
),
throwsA
(
isA
<
PreparePackageException
>()));
});
...
...
@@ -216,7 +214,7 @@ void main() {
else
if
(
platform
.
isMacOS
)
'zip -r -9 --symlinks
$archiveName
flutter'
:
null
else
if
(
platform
.
isLinux
)
'tar cJf
$archiveName
flutter'
:
null
,
};
processManager
.
fakeResults
=
calls
;
processManager
.
addCommands
(
convertResults
(
calls
))
;
creator
=
ArchiveCreator
(
tempDir
,
tempDir
,
...
...
@@ -230,7 +228,6 @@ void main() {
);
await
creator
.
initializeRepo
();
await
creator
.
createArchive
();
processManager
.
verifyCalls
(
calls
.
keys
.
toList
());
});
});
...
...
@@ -247,7 +244,7 @@ void main() {
final
String
newGsArchivePath
=
'gs://flutter_infra_release/releases/stable/
$platformName
/
$archiveName
'
;
setUp
(()
async
{
processManager
=
FakeProcessManager
(
);
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[]
);
tempDir
=
Directory
.
systemTemp
.
createTempSync
(
'flutter_prepage_package_test.'
);
});
...
...
@@ -312,7 +309,7 @@ void main() {
'
$gsutilCall
-- rm
$newGsJsonPath
'
:
null
,
'
$gsutilCall
-- -h Content-Type:application/json cp
$jsonPath
$newGsJsonPath
'
:
null
,
};
processManager
.
fakeResults
=
calls
;
processManager
.
addCommands
(
convertResults
(
calls
))
;
final
File
outputFile
=
File
(
path
.
join
(
tempDir
.
absolute
.
path
,
archiveName
));
outputFile
.
createSync
();
assert
(
tempDir
.
existsSync
());
...
...
@@ -329,7 +326,7 @@ void main() {
);
assert
(
tempDir
.
existsSync
());
await
publisher
.
publishArchive
();
processManager
.
verifyCalls
(
calls
.
keys
.
toList
());
final
File
releaseFile
=
File
(
jsonPath
);
expect
(
releaseFile
.
existsSync
(),
isTrue
);
final
String
contents
=
releaseFile
.
readAsStringSync
();
...
...
@@ -376,9 +373,8 @@ void main() {
// This process returns 0 because file already exists
'
$gsutilCall
-- stat
$gsArchivePath
'
:
<
ProcessResult
>[
ProcessResult
(
0
,
0
,
''
,
''
)],
};
processManager
.
fakeResults
=
calls
;
processManager
.
addCommands
(
convertResults
(
calls
))
;
expect
(()
async
=>
publisher
.
publishArchive
(
false
),
throwsException
);
processManager
.
verifyCalls
(
calls
.
keys
.
toList
());
});
test
(
'publishArchive does not throw if forceUpload is true and artifact already exists on cloud storage'
,
()
async
{
...
...
@@ -448,11 +444,33 @@ void main() {
'
$gsutilCall
-- rm
$newGsJsonPath
'
:
null
,
'
$gsutilCall
-- -h Content-Type:application/json cp
$jsonPath
$newGsJsonPath
'
:
null
,
};
processManager
.
fakeResults
=
calls
;
processManager
.
addCommands
(
convertResults
(
calls
))
;
assert
(
tempDir
.
existsSync
());
await
publisher
.
publishArchive
(
true
);
processManager
.
verifyCalls
(
calls
.
keys
.
toList
());
});
});
}
}
List
<
FakeCommand
>
convertResults
(
Map
<
String
,
List
<
ProcessResult
>>
results
)
{
final
List
<
FakeCommand
>
commands
=
<
FakeCommand
>[];
for
(
final
String
key
in
results
.
keys
)
{
final
List
<
ProcessResult
>
candidates
=
results
[
key
];
final
List
<
String
>
args
=
key
.
split
(
' '
);
if
(
candidates
==
null
)
{
commands
.
add
(
FakeCommand
(
command:
args
,
));
}
else
{
for
(
final
ProcessResult
result
in
candidates
)
{
commands
.
add
(
FakeCommand
(
command:
args
,
exitCode:
result
.
exitCode
,
stderr:
result
.
stderr
?.
toString
(),
stdout:
result
.
stdout
?.
toString
(),
));
}
}
}
return
commands
;
}
dev/bots/test/test_test.dart
View file @
2edf6b73
...
...
@@ -6,22 +6,20 @@ import 'dart:io' hide Platform;
import
'package:file/file.dart'
as
fs
;
import
'package:file/memory.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:path/path.dart'
as
path
;
import
'package:process/process.dart'
;
import
'../test.dart'
;
import
'common.dart'
;
class
MockFile
extends
Mock
implements
File
{}
void
main
(
)
{
MockFile
file
;
setUp
(()
{
file
=
MockFile
();
when
(
file
.
existsSync
()).
thenReturn
(
true
);
});
group
(
'verifyVersion()'
,
()
{
MemoryFileSystem
fileSystem
;
setUp
(()
{
fileSystem
=
MemoryFileSystem
.
test
();
});
test
(
'passes for valid version strings'
,
()
async
{
const
List
<
String
>
valid_versions
=
<
String
>[
'1.2.3'
,
...
...
@@ -31,7 +29,9 @@ void main() {
'1.2.3-5.0.pre.12'
,
];
for
(
final
String
version
in
valid_versions
)
{
when
(
file
.
readAsString
()).
thenAnswer
((
Invocation
invocation
)
=>
Future
<
String
>.
value
(
version
));
final
File
file
=
fileSystem
.
file
(
'version'
);
file
.
writeAsStringSync
(
version
);
expect
(
await
verifyVersion
(
file
),
isNull
,
...
...
@@ -51,7 +51,9 @@ void main() {
'1.2.3-hotfix.1'
,
];
for
(
final
String
version
in
invalid_versions
)
{
when
(
file
.
readAsString
()).
thenAnswer
((
Invocation
invocation
)
=>
Future
<
String
>.
value
(
version
));
final
File
file
=
fileSystem
.
file
(
'version'
);
file
.
writeAsStringSync
(
version
);
expect
(
await
verifyVersion
(
file
),
'The version logic generated an invalid version string: "
$version
".'
,
...
...
dev/integration_tests/flutter_gallery/pubspec.yaml
View file @
2edf6b73
...
...
@@ -13,7 +13,7 @@ dependencies:
string_scanner
:
1.1.0
url_launcher
:
6.0.2
cupertino_icons
:
1.0.2
video_player
:
2.0.
0
video_player
:
2.0.
1
scoped_model
:
git
:
url
:
https://github.com/kevmoo/scoped_model.git
...
...
@@ -272,4 +272,4 @@ flutter:
-
asset
:
packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Regular.ttf
-
asset
:
packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Light.ttf
# PUBSPEC CHECKSUM:
32e0
# PUBSPEC CHECKSUM:
b0e1
dev/tools/pubspec.yaml
View file @
2edf6b73
...
...
@@ -7,91 +7,60 @@ environment:
dependencies
:
archive
:
3.1.2
args
:
1.6.0
flutter_tools
:
path
:
'
../../packages/flutter_tools'
http
:
0.12.2
intl
:
0.17.0
meta
:
1.3.0
path
:
1.8.0
process
:
4.1.0
charcode
:
1.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
clock
:
1.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection
:
1.15.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
crypto
:
3.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
file
:
6.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
http_parser
:
3.1.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pedantic
:
1.11.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
platform
:
3.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
source_span
:
1.8.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
string_scanner
:
1.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
term_glyph
:
1.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
typed_data
:
1.3.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies
:
test
:
1.16.5
test_api
:
0.2.19
_fe_analyzer_shared
:
14.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
analyzer
:
0.41.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.5.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
2.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
browser_launcher
:
0.1.8
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
built_collection
:
4.3.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
built_value
:
7.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
cli_util
:
0.3.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
clock
:
1.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection
:
1.15.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
completion
:
0.2.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
convert
:
3.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
coverage
:
0.15.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
crypto
:
3.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib
:
0.17.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dds
:
1.7.5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
devtools
:
0.9.7+3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
devtools_server
:
0.9.7+3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
devtools_shared
:
0.9.7+3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dwds
:
8.0.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
fake_async
:
1.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
file
:
6.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
fixnum
:
0.10.11
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
flutter_template_images
:
1.0.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
glob
:
2.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
html
:
0.15.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
http_multi_server
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
http_parser
:
3.1.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
io
:
1.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
js
on_rpc_2
:
2.2.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
js
:
0.6.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
logging
:
0.11.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
matcher
:
0.12.10
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
mime
:
1.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
multicast_dns
:
0.2.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
mustache_template
:
2.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
native_stack_traces
:
0.3.7
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
node_preamble
:
1.4.13
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
package_config
:
1.9.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pedantic
:
1.11.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
petitparser
:
4.0.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
platform
:
3.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pool
:
1.5.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pub_semver
:
1.4.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
quiver
:
2.1.5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
shelf
:
0.7.9
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
shelf_packages_handler
:
2.0.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
shelf_proxy
:
0.1.0+7
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
shelf_static
:
0.2.9+2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
shelf_web_socket
:
0.2.4+1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
source_map_stack_trace
:
2.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
source_maps
:
0.10.10
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
source_span
:
1.8.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
sse
:
3.8.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
stack_trace
:
1.10.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
stream_channel
:
2.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
string_scanner
:
1.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
sync_http
:
0.3.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
term_glyph
:
1.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
test_core
:
0.3.15
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
typed_data
:
1.3.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
usage
:
3.4.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
uuid
:
3.0.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
vm_service
:
6.0.1-nullsafety.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
vm_snapshot_analysis
:
0.5.6
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
watcher
:
1.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
web_socket_channel
:
1.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
webdriver
:
3.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
webkit_inspection_protocol
:
0.7.5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
xml
:
5.0.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
yaml
:
3.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies
:
test
:
1.16.5
test_api
:
0.2.19
mockito
:
4.1.1
js
:
0.6.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
node_preamble
:
1.4.13
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM: fbfe
# PUBSPEC CHECKSUM: c5cc
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