Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap crash reporting with unified analytics #147296

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eliasyishak
Copy link
Contributor

Fixes:

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.


setUp(() async {
logger = BufferLogger.test();
fs = MemoryFileSystem.test();
testUsage = TestUsage();
fakeAnalytics = getInitializedFakeAnalyticsInstance(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about instead we just use our own implementation of this class, such as:

class FakeAnalytics extends Fake implements Analytics {
  const FakeAnalytics({this.okToSend = true});
  
  @override
  bool okToSend;
  
  @override
  void suppressTelemetry() => okToSend = false;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't done a deep dive on getInitializedFakeAnalyticsInstance, but I am inclined to agree with this suggestion. Speaking generally, I think it's good for a test to fake as little as needed so that it's more clear as to what that test depends upon.

@andrewkolos andrewkolos self-assigned this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use package:unified_analytics to decide if we should send a crash report
3 participants