Unverified Commit f8e70a84 authored by crisboarna's avatar crisboarna Committed by GitHub

feat(flutter_tools): Added doctor path printing on verbose (#95453)

parent 9ad90252
......@@ -25,6 +25,7 @@ class UserMessages {
String engineRevision(String revision) => 'Engine revision $revision';
String dartRevision(String revision) => 'Dart version $revision';
String devToolsVersion(String version) => 'DevTools version $version';
String userPath(String? path) => 'PATH = $path';
String pubMirrorURL(String url) => 'Pub download mirror $url';
String flutterMirrorURL(String url) => 'Flutter download mirror $url';
String get flutterBinariesDoNotRun =>
......
......@@ -458,6 +458,7 @@ class FlutterValidator extends DoctorValidator {
messages.add(ValidationMessage(_userMessages.engineRevision(version.engineRevisionShort)));
messages.add(ValidationMessage(_userMessages.dartRevision(version.dartSdkVersion)));
messages.add(ValidationMessage(_userMessages.devToolsVersion(_devToolsVersion())));
messages.add(ValidationMessage(_userMessages.userPath(_platform.environment['PATH'])));
final String? pubUrl = _platform.environment['PUB_HOSTED_URL'];
if (pubUrl != null) {
messages.add(ValidationMessage(_userMessages.pubMirrorURL(pubUrl)));
......
......@@ -188,6 +188,31 @@ void main() {
));
});
testWithoutContext('FlutterValidator shows PATH environment variable when set', () async {
final FlutterValidator flutterValidator = FlutterValidator(
platform: FakePlatform(
localeName: 'en_US.UTF-8',
environment: <String, String> {
'PATH': '/usr/bin:/usr/local/bin:/home/user/.bin',
},
),
flutterVersion: () => FakeFlutterVersion(frameworkVersion: '1.0.0'),
devToolsVersion: () => '2.8.0',
userMessages: UserMessages(),
artifacts: Artifacts.test(),
fileSystem: MemoryFileSystem.test(),
processManager: FakeProcessManager.any(),
operatingSystemUtils: FakeOperatingSystemUtils(name: 'Linux'),
flutterRoot: () => 'sdk/flutter',
);
expect(await flutterValidator.validate(), _matchDoctorValidation(
validationType: ValidationType.installed,
statusInfo: 'Channel unknown, 1.0.0, on Linux, locale en_US.UTF-8',
messages: contains(const ValidationMessage('PATH = /usr/bin:/usr/local/bin:/home/user/.bin')),
));
});
group('FlutterValidator shows flutter upstream remote', () {
testWithoutContext('default url', () async {
final FlutterValidator flutterValidator = FlutterValidator(
......
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