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
aecd5e03
Unverified
Commit
aecd5e03
authored
Apr 28, 2021
by
Erick
Committed by
GitHub
Apr 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] always build test assets (#81341)
parent
1575537a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+1
-1
test_test.dart
...flutter_tools/test/commands.shard/hermetic/test_test.dart
+41
-0
No files found.
packages/flutter_tools/lib/src/commands/test.dart
View file @
aecd5e03
...
...
@@ -315,7 +315,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
);
}
if
(
buildTestAssets
&&
flutterProject
.
manifest
.
assets
.
isNotEmpty
)
{
if
(
buildTestAssets
)
{
await
_buildTestAsset
();
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/test_test.dart
View file @
aecd5e03
...
...
@@ -604,6 +604,47 @@ dev_dependencies:
FakeDevice
(
'ephemeral'
,
'ephemeral'
,
ephemeral:
true
,
isSupported:
true
,
type:
PlatformType
.
android
),
]),
});
testUsingContext
(
'Builds the asset manifest by default'
,
()
async
{
final
FakeFlutterTestRunner
testRunner
=
FakeFlutterTestRunner
(
0
);
final
TestCommand
testCommand
=
TestCommand
(
testRunner:
testRunner
);
final
CommandRunner
<
void
>
commandRunner
=
createTestCommandRunner
(
testCommand
);
await
commandRunner
.
run
(
const
<
String
>[
'test'
,
'--no-pub'
,
]);
final
bool
fileExists
=
await
fs
.
isFile
(
'build/unit_test_assets/AssetManifest.json'
);
expect
(
fileExists
,
true
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
DeviceManager:
()
=>
_FakeDeviceManager
(<
Device
>[]),
});
testUsingContext
(
'Don
\'
t build the asset manifest if --no-test-assets if informed'
,
()
async
{
final
FakeFlutterTestRunner
testRunner
=
FakeFlutterTestRunner
(
0
);
final
TestCommand
testCommand
=
TestCommand
(
testRunner:
testRunner
);
final
CommandRunner
<
void
>
commandRunner
=
createTestCommandRunner
(
testCommand
);
await
commandRunner
.
run
(
const
<
String
>[
'test'
,
'--no-pub'
,
'--no-test-assets'
,
]);
final
bool
fileExists
=
await
fs
.
isFile
(
'build/unit_test_assets/AssetManifest.json'
);
expect
(
fileExists
,
false
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
DeviceManager:
()
=>
_FakeDeviceManager
(<
Device
>[]),
});
}
class
FakeFlutterTestRunner
implements
FlutterTestRunner
{
...
...
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