diff --git a/dev/bots/test.dart b/dev/bots/test.dart index da70f287009..ee098f80893 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -276,13 +276,10 @@ Future _runGeneralToolTests() async { } Future _runCommandsToolTests() async { - // Due to https://github.com/flutter/flutter/issues/46180, skip the hermetic directory - // on Windows. - final String suffix = Platform.isWindows ? 'permeable' : ''; await _pubRunTest( path.join(flutterRoot, 'packages', 'flutter_tools'), forceSingleCore: true, - testPaths: [path.join('test', 'commands.shard', suffix)], + testPaths: [path.join('test', 'commands.shard')], ); } diff --git a/packages/flutter_tools/test/commands.shard/hermetic/generate_localizations_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/generate_localizations_test.dart index 6deed87f0b4..f3b9d6e9a83 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/generate_localizations_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/generate_localizations_test.dart @@ -7,6 +7,7 @@ import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; +import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/generate_localizations.dart'; import 'package:flutter_tools/src/runner/flutter_command.dart'; @@ -16,8 +17,17 @@ import '../../src/context.dart'; import '../../src/test_flutter_command_runner.dart'; void main() { + FileSystem fileSystem; + + setUpAll(() { + Cache.disableLocking(); + }); + + setUp(() { + fileSystem = MemoryFileSystem.test(); + }); + testUsingContext('default l10n settings', () async { - final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb')) ..createSync(recursive: true); @@ -40,10 +50,12 @@ void main() { expect(outputDirectory.existsSync(), true); expect(outputDirectory.childFile('app_localizations_en.dart').existsSync(), true); expect(outputDirectory.childFile('app_localizations.dart').existsSync(), true); + }, overrides: { + FileSystem: () => fileSystem, + ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('not using synthetic packages', () async { - final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); final Directory l10nDirectory = fileSystem.directory( fileSystem.path.join('lib', 'l10n'), @@ -74,10 +86,12 @@ void main() { expect(l10nDirectory.existsSync(), true); expect(l10nDirectory.childFile('app_localizations_en.dart').existsSync(), true); expect(l10nDirectory.childFile('app_localizations.dart').existsSync(), true); + }, overrides: { + FileSystem: () => fileSystem, + ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('throws error when arguments are invalid', () async { - final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb')) ..createSync(recursive: true); @@ -102,10 +116,12 @@ void main() { ]), throwsToolExit(), ); + }, overrides: { + FileSystem: () => fileSystem, + ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('l10n yaml file takes precedence over command line arguments', () async { - final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb')) ..createSync(recursive: true); @@ -132,5 +148,8 @@ void main() { expect(outputDirectory.existsSync(), true); expect(outputDirectory.childFile('app_localizations_en.dart').existsSync(), true); expect(outputDirectory.childFile('app_localizations.dart').existsSync(), true); + }, overrides: { + FileSystem: () => fileSystem, + ProcessManager: () => FakeProcessManager.any(), }); }