Unverified Commit 450fc25c authored by Zachary Anderson's avatar Zachary Anderson Committed by GitHub

[flutter_tool] Disable analytics on more bots (#50669)

parent 232063e5
...@@ -66,6 +66,11 @@ class BotDetector { ...@@ -66,6 +66,11 @@ class BotDetector {
|| _platform.environment['CHROME_HEADLESS'] == '1' || _platform.environment['CHROME_HEADLESS'] == '1'
|| _platform.environment.containsKey('BUILDBOT_BUILDERNAME') || _platform.environment.containsKey('BUILDBOT_BUILDERNAME')
|| _platform.environment.containsKey('SWARMING_TASK_ID') || _platform.environment.containsKey('SWARMING_TASK_ID')
// Property when running on borg.
|| _platform.environment.containsKey('BORG_ALLOC_DIR')
// Property when running on Azure.
|| await _azureDetector.isRunningOnAzure; || await _azureDetector.isRunningOnAzure;
} }
} }
......
...@@ -67,6 +67,11 @@ void main() { ...@@ -67,6 +67,11 @@ void main() {
when(mockHttpClientRequest.headers).thenReturn(mockHttpHeaders); when(mockHttpClientRequest.headers).thenReturn(mockHttpHeaders);
expect(await botDetector.isRunningOnBot, isTrue); expect(await botDetector.isRunningOnBot, isTrue);
}); });
testWithoutContext('returns true when running on borg', () async {
fakePlatform.environment['BORG_ALLOC_DIR'] = 'true';
expect(await botDetector.isRunningOnBot, isTrue);
});
}); });
}); });
......
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