Unverified Commit 9fa0f3b2 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

fix test for null flutter root (#44468)

parent 03ac37af
...@@ -87,11 +87,16 @@ class AssembleCommand extends FlutterCommand { ...@@ -87,11 +87,16 @@ class AssembleCommand extends FlutterCommand {
if (futterProject == null) { if (futterProject == null) {
return const <CustomDimensions, String>{}; return const <CustomDimensions, String>{};
} }
try {
final Environment localEnvironment = environment; final Environment localEnvironment = environment;
return <CustomDimensions, String>{ return <CustomDimensions, String>{
CustomDimensions.commandBuildBundleTargetPlatform: localEnvironment.defines['TargetPlatform'], CustomDimensions.commandBuildBundleTargetPlatform: localEnvironment.defines['TargetPlatform'],
CustomDimensions.commandBuildBundleIsModule: '${futterProject.isModule}', CustomDimensions.commandBuildBundleIsModule: '${futterProject.isModule}',
}; };
} catch (err) {
// We've failed to send usage.
}
return const <CustomDimensions, String>{};
} }
/// The target we are building. /// The target we are building.
......
...@@ -18,15 +18,13 @@ import '../../src/testbed.dart'; ...@@ -18,15 +18,13 @@ import '../../src/testbed.dart';
void main() { void main() {
Testbed testbed; Testbed testbed;
MockBuildSystem mockBuildSystem; MockBuildSystem mockBuildSystem;
setUpAll(() {
Cache.disableLocking(); Cache.disableLocking();
});
setUp(() { setUp(() {
mockBuildSystem = MockBuildSystem(); mockBuildSystem = MockBuildSystem();
testbed = Testbed(overrides: <Type, Generator>{ testbed = Testbed(overrides: <Type, Generator>{
BuildSystem: () => mockBuildSystem, BuildSystem: () => mockBuildSystem,
Cache: () => FakeCache(),
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment