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
90a592bf
Unverified
Commit
90a592bf
authored
May 14, 2022
by
Jonah Williams
Committed by
GitHub
May 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] fix test asset loading (#103667)
parent
d3b80f88
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
28 additions
and
20 deletions
+28
-20
package_assets_test.dart
dev/automated_tests/flutter_test/package_assets_test.dart
+0
-1
pubspec.yaml
dev/automated_tests/pubspec.yaml
+1
-1
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+4
-1
flutter_platform.dart
packages/flutter_tools/lib/src/test/flutter_platform.dart
+5
-5
flutter_tester_device.dart
...ges/flutter_tools/lib/src/test/flutter_tester_device.dart
+7
-5
runner.dart
packages/flutter_tools/lib/src/test/runner.dart
+3
-3
test_test.dart
...flutter_tools/test/commands.shard/hermetic/test_test.dart
+1
-1
flutter_platform_test.dart
...utter_tools/test/general.shard/flutter_platform_test.dart
+2
-2
flutter_tester_device_test.dart
..._tools/test/general.shard/flutter_tester_device_test.dart
+5
-1
No files found.
dev/automated_tests/flutter_test/package_assets_test.dart
View file @
90a592bf
...
...
@@ -13,7 +13,6 @@ void main() {
width:
54
,
height:
54
,
fit:
BoxFit
.
none
,
package:
'flutter_automated_tests'
,
),
);
});
...
...
dev/automated_tests/pubspec.yaml
View file @
90a592bf
...
...
@@ -70,6 +70,6 @@ dependencies:
flutter
:
uses-material-design
:
true
assets
:
-
icon/
-
icon/test.png
# PUBSPEC CHECKSUM: 53c0
packages/flutter_tools/lib/src/commands/test.dart
View file @
90a592bf
...
...
@@ -320,8 +320,11 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
);
}
String
testAssetDirectory
;
if
(
buildTestAssets
)
{
await
_buildTestAsset
();
testAssetDirectory
=
globals
.
fs
.
path
.
join
(
flutterProject
?.
directory
?.
path
??
''
,
'build'
,
'unit_test_assets'
);
}
final
bool
startPaused
=
boolArgDeprecated
(
'start-paused'
);
...
...
@@ -444,7 +447,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
machine:
machine
,
updateGoldens:
boolArgDeprecated
(
'update-goldens'
),
concurrency:
jobs
,
buildTestAssets:
buildTestAssets
,
testAssetDirectory:
testAssetDirectory
,
flutterProject:
flutterProject
,
web:
stringArgDeprecated
(
'platform'
)
==
'chrome'
,
randomSeed:
stringArgDeprecated
(
'test-randomize-ordering-seed'
),
...
...
packages/flutter_tools/lib/src/test/flutter_platform.dart
View file @
90a592bf
...
...
@@ -55,7 +55,7 @@ FlutterPlatform installHook({
String
precompiledDillPath
,
Map
<
String
,
String
>
precompiledDillFiles
,
bool
updateGoldens
=
false
,
bool
buildTestAssets
=
false
,
String
testAssetDirectory
,
InternetAddressType
serverType
=
InternetAddressType
.
IPv4
,
Uri
projectRootDirectory
,
FlutterProject
flutterProject
,
...
...
@@ -86,7 +86,7 @@ FlutterPlatform installHook({
precompiledDillPath:
precompiledDillPath
,
precompiledDillFiles:
precompiledDillFiles
,
updateGoldens:
updateGoldens
,
buildTestAssets:
buildTestAssets
,
testAssetDirectory:
testAssetDirectory
,
projectRootDirectory:
projectRootDirectory
,
flutterProject:
flutterProject
,
icudtlPath:
icudtlPath
,
...
...
@@ -280,7 +280,7 @@ class FlutterPlatform extends PlatformPlugin {
this.precompiledDillPath,
this.precompiledDillFiles,
this.updateGoldens,
this.
buildTestAssets
,
this.
testAssetDirectory
,
this.projectRootDirectory,
this.flutterProject,
this.icudtlPath,
...
...
@@ -297,7 +297,7 @@ class FlutterPlatform extends PlatformPlugin {
final String precompiledDillPath;
final Map<String, String> precompiledDillFiles;
final bool updateGoldens;
final
bool buildTestAssets
;
final
String testAssetDirectory
;
final Uri projectRootDirectory;
final FlutterProject flutterProject;
final String icudtlPath;
...
...
@@ -419,7 +419,7 @@ class FlutterPlatform extends PlatformPlugin {
machine:
machine
,
debuggingOptions:
debuggingOptions
,
host:
host
,
buildTestAssets:
buildTestAssets
,
testAssetDirectory:
testAssetDirectory
,
flutterProject:
flutterProject
,
icudtlPath:
icudtlPath
,
compileExpression:
_compileExpressionService
,
...
...
packages/flutter_tools/lib/src/test/flutter_tester_device.dart
View file @
90a592bf
...
...
@@ -39,7 +39,7 @@ class FlutterTesterTestDevice extends TestDevice {
@required
this
.
enableObservatory
,
@required
this
.
machine
,
@required
this
.
host
,
@required
this
.
buildTestAssets
,
@required
this
.
testAssetDirectory
,
@required
this
.
flutterProject
,
@required
this
.
icudtlPath
,
@required
this
.
compileExpression
,
...
...
@@ -66,7 +66,7 @@ class FlutterTesterTestDevice extends TestDevice {
final
bool
enableObservatory
;
final
bool
machine
;
final
InternetAddress
host
;
final
bool
buildTestAssets
;
final
String
testAssetDirectory
;
final
FlutterProject
flutterProject
;
final
String
icudtlPath
;
final
CompileExpression
compileExpression
;
...
...
@@ -93,7 +93,6 @@ class FlutterTesterTestDevice extends TestDevice {
// Let the server choose an unused port.
_server
=
await
bind
(
host
,
/*port*/
0
);
logger
.
printTrace
(
'test
$id
: test harness socket server is running at port:
${_server.port}
'
);
final
List
<
String
>
command
=
<
String
>[
// Until an arm64 flutter tester binary is available, force to run in Rosetta
// to avoid "unexpectedly got a signal in sigtramp" crash.
...
...
@@ -128,7 +127,10 @@ class FlutterTesterTestDevice extends TestDevice {
'--enable-dart-profiling'
,
'--non-interactive'
,
'--use-test-fonts'
,
'--disable-asset-fonts'
,
'--packages=
${debuggingOptions.buildInfo.packagesPath}
'
,
if
(
testAssetDirectory
!=
null
)
'--flutter-assets-dir=
$testAssetDirectory
'
,
if
(
debuggingOptions
.
nullAssertions
)
'--dart-flags=--null_assertions'
,
...
debuggingOptions
.
dartEntrypointArgs
,
...
...
@@ -148,8 +150,8 @@ class FlutterTesterTestDevice extends TestDevice {
'FONTCONFIG_FILE'
:
fontConfigManager
.
fontConfigFile
.
path
,
'SERVER_PORT'
:
_server
.
port
.
toString
(),
'APP_NAME'
:
flutterProject
?.
manifest
?.
appName
??
''
,
if
(
buildTestAssets
)
'UNIT_TEST_ASSETS'
:
fileSystem
.
path
.
join
(
flutterProject
?.
directory
?.
path
??
''
,
'build'
,
'unit_test_assets'
)
,
if
(
testAssetDirectory
!=
null
)
'UNIT_TEST_ASSETS'
:
testAssetDirectory
,
};
logger
.
printTrace
(
'test
$id
: Starting flutter_tester process with command=
$command
, environment=
$environment
'
);
...
...
packages/flutter_tools/lib/src/test/runner.dart
View file @
90a592bf
...
...
@@ -42,7 +42,7 @@ abstract class FlutterTestRunner {
bool
updateGoldens
=
false
,
TestWatcher
watcher
,
@required
int
concurrency
,
bool
buildTestAssets
=
false
,
String
testAssetDirectory
,
FlutterProject
flutterProject
,
String
icudtlPath
,
Directory
coverageDirectory
,
...
...
@@ -78,7 +78,7 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner {
bool
updateGoldens
=
false
,
TestWatcher
watcher
,
@required
int
concurrency
,
bool
buildTestAssets
=
false
,
String
testAssetDirectory
,
FlutterProject
flutterProject
,
String
icudtlPath
,
Directory
coverageDirectory
,
...
...
@@ -202,7 +202,7 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner {
precompiledDillPath:
precompiledDillPath
,
precompiledDillFiles:
precompiledDillFiles
,
updateGoldens:
updateGoldens
,
buildTestAssets:
buildTestAssets
,
testAssetDirectory:
testAssetDirectory
,
projectRootDirectory:
globals
.
fs
.
currentDirectory
.
uri
,
flutterProject:
flutterProject
,
icudtlPath:
icudtlPath
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/test_test.dart
View file @
90a592bf
...
...
@@ -754,7 +754,7 @@ class FakeFlutterTestRunner implements FlutterTestRunner {
bool
updateGoldens
=
false
,
TestWatcher
watcher
,
int
concurrency
,
bool
buildTestAssets
=
false
,
String
testAssetDirectory
,
FlutterProject
flutterProject
,
String
icudtlPath
,
Directory
coverageDirectory
,
...
...
packages/flutter_tools/test/general.shard/flutter_platform_test.dart
View file @
90a592bf
...
...
@@ -95,7 +95,7 @@ void main() {
precompiledDillPath:
'def'
,
precompiledDillFiles:
expectedPrecompiledDillFiles
,
updateGoldens:
true
,
buildTestAssets:
true
,
testAssetDirectory:
'/build/test'
,
serverType:
InternetAddressType
.
IPv6
,
icudtlPath:
'ghi'
,
platformPluginRegistration:
(
FlutterPlatform
platform
)
{
...
...
@@ -114,7 +114,7 @@ void main() {
expect
(
flutterPlatform
.
precompiledDillPath
,
equals
(
'def'
));
expect
(
flutterPlatform
.
precompiledDillFiles
,
expectedPrecompiledDillFiles
);
expect
(
flutterPlatform
.
updateGoldens
,
equals
(
true
));
expect
(
flutterPlatform
.
buildTestAssets
,
equals
(
true
)
);
expect
(
flutterPlatform
.
testAssetDirectory
,
'/build/test'
);
expect
(
flutterPlatform
.
icudtlPath
,
equals
(
'ghi'
));
});
});
...
...
packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart
View file @
90a592bf
...
...
@@ -87,6 +87,7 @@ void main() {
'--enable-dart-profiling'
,
'--non-interactive'
,
'--use-test-fonts'
,
'--disable-asset-fonts'
,
'--packages=.dart_tool/package_config.json'
,
'example.dill'
,
],
environment:
<
String
,
String
>{
...
...
@@ -131,6 +132,7 @@ void main() {
'--enable-dart-profiling'
,
'--non-interactive'
,
'--use-test-fonts'
,
'--disable-asset-fonts'
,
'--packages=.dart_tool/package_config.json'
,
'example.dill'
,
],
environment:
<
String
,
String
>{
...
...
@@ -203,6 +205,7 @@ void main() {
'--enable-dart-profiling'
,
'--non-interactive'
,
'--use-test-fonts'
,
'--disable-asset-fonts'
,
'--packages=.dart_tool/package_config.json'
,
'--foo'
,
'--bar'
,
...
...
@@ -244,6 +247,7 @@ void main() {
'--enable-dart-profiling'
,
'--non-interactive'
,
'--use-test-fonts'
,
'--disable-asset-fonts'
,
'--packages=.dart_tool/package_config.json'
,
'example.dill'
,
],
...
...
@@ -293,7 +297,7 @@ class TestFlutterTesterDevice extends FlutterTesterTestDevice {
enableObservatory:
enableObservatory
,
machine:
false
,
host:
InternetAddress
.
loopbackIPv6
,
buildTestAssets:
false
,
testAssetDirectory:
null
,
flutterProject:
null
,
icudtlPath:
null
,
compileExpression:
null
,
...
...
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