Skip to content

Conversation

@eliasyishak
Copy link
Contributor

Fixes:

Pre-launch Checklist

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

logger = BufferLogger.test();
fs = MemoryFileSystem.test();
testUsage = TestUsage();
fakeAnalytics = getInitializedFakeAnalyticsInstance(
Copy link
Contributor

@christopherfujino christopherfujino Apr 24, 2024

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
@andrewkolos
Copy link
Contributor

We should land this before GA3 is taken offline

@andrewkolos
Copy link
Contributor

I'll be remaking this PR since the cla/google check is failing.

auto-submit bot pushed a commit that referenced this pull request May 18, 2024
Fixes: #147260

(this is a remake of #147296; in hindsight I could have force-pushed there instead but �)
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