Remove message about pub cache that is not actionable (#143357)
... and neither the pub nor tools team think it's important. Fixes https://github.com/flutter/flutter/issues/140628.
This commit is contained in:
@@ -866,98 +866,11 @@ exit code: 66
|
||||
await pub.get(
|
||||
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
|
||||
context: PubContext.flutterTests);
|
||||
expect(logger.statusText, isNot(contains('Found an existing Pub cache')));
|
||||
expect(logger.statusText,
|
||||
isNot(contains('Found an existing Dart Analysis Server cache')));
|
||||
|
||||
expect(processManager, hasNoRemainingExpectations);
|
||||
expect(preloadCache.existsSync(), false);
|
||||
});
|
||||
|
||||
testWithoutContext('Notifies about existing caches, on first run only',
|
||||
() async {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
final Directory preloadCache =
|
||||
fileSystem.currentDirectory.childDirectory('.pub-preload-cache');
|
||||
preloadCache.childFile('a.tar.gz').createSync(recursive: true);
|
||||
fileSystem.currentDirectory.childFile('version').createSync();
|
||||
fileSystem.directory('/global/.pub-cache').createSync(recursive: true);
|
||||
fileSystem.directory('/global/.dartServer').createSync(recursive: true);
|
||||
|
||||
const FakeCommand dartPreloadCommand = FakeCommand(
|
||||
command: <String>[
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'pub',
|
||||
'--suppress-analytics',
|
||||
'cache',
|
||||
'preload',
|
||||
'.pub-preload-cache/a.tar.gz',
|
||||
],
|
||||
);
|
||||
final FakeCommand dartPubGetCommand = FakeCommand(
|
||||
command: const <String>[
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'pub',
|
||||
'--suppress-analytics',
|
||||
'--directory',
|
||||
'.',
|
||||
'get',
|
||||
'--example',
|
||||
],
|
||||
environment: const <String, String>{
|
||||
'FLUTTER_ROOT': '',
|
||||
'PUB_ENVIRONMENT': 'flutter_cli:flutter_tests',
|
||||
},
|
||||
onRun: (_) {
|
||||
fileSystem.currentDirectory
|
||||
.childDirectory('.dart_tool')
|
||||
.childFile('package_config.json')
|
||||
.createSync(recursive: true);
|
||||
});
|
||||
|
||||
final FakeProcessManager processManager =
|
||||
FakeProcessManager.list(<FakeCommand>[
|
||||
dartPreloadCommand,
|
||||
dartPubGetCommand,
|
||||
dartPubGetCommand,
|
||||
]);
|
||||
|
||||
final Platform platform =
|
||||
FakePlatform(environment: <String, String>{'HOME': '/global'});
|
||||
final BufferLogger logger = BufferLogger.test();
|
||||
final Pub pub = Pub.test(
|
||||
platform: platform,
|
||||
usage: TestUsage(),
|
||||
fileSystem: fileSystem,
|
||||
logger: logger,
|
||||
processManager: processManager,
|
||||
botDetector: const BotDetectorAlwaysNo(),
|
||||
stdio: FakeStdio(),
|
||||
);
|
||||
|
||||
await pub.get(
|
||||
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
|
||||
context: PubContext.flutterTests);
|
||||
expect(logger.statusText,
|
||||
contains('Found an existing Pub cache at /global/.pub-cache'));
|
||||
expect(logger.statusText,
|
||||
contains('It can be reset by running `dart pub cache clean`'));
|
||||
expect(
|
||||
logger.statusText,
|
||||
contains(
|
||||
'Found an existing Dart Analysis Server cache at /global/.dartServer'),
|
||||
);
|
||||
expect(preloadCache.existsSync(), false);
|
||||
logger.clear();
|
||||
await pub.get(
|
||||
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
|
||||
context: PubContext.flutterTests);
|
||||
expect(logger.statusText, isNot(contains('Found an existing Pub cache')));
|
||||
expect(logger.statusText,
|
||||
isNot(contains('Found an existing Dart Analysis Server cache')));
|
||||
expect(processManager, hasNoRemainingExpectations);
|
||||
});
|
||||
|
||||
testWithoutContext('pub cache in environment is used', () async {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
fileSystem.directory('custom/pub-cache/path').createSync(recursive: true);
|
||||
|
||||
Reference in New Issue
Block a user