Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkgs/unified_analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 8.0.4
- Changed `Event.flutterWasmDryRun` to track dart2wasm dry run metrics from Flutter.

## 8.0.3
- Changed `Event.contextStructure` to make optional data that's no longer being
collected and to add data about the size of library cycles.
Expand Down
5 changes: 5 additions & 0 deletions pkgs/unified_analytics/lib/src/enums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ enum DashEvent {
description: 'Provides information about flutter commands that ran',
toolOwner: DashTool.flutterTool,
),
flutterWasmDryRun(
label: 'wasm_dry_run',
description: 'Information for a dart2wasm dry run invoked from Flutter',
toolOwner: DashTool.flutterTool,
),
flutterInjectDarwinPlugins(
label: 'flutter_inject_darwin_plugins',
description: 'Information on plugins injected into an iOS/macOS project',
Expand Down
13 changes: 13 additions & 0 deletions pkgs/unified_analytics/lib/src/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,19 @@ final class Event {
},
);

Event.flutterWasmDryRun({
required String result,
required int exitCode,
String? findingsSummary,
}) : this._(
eventName: DashEvent.flutterWasmDryRun,
eventData: {
'result': result,
'exitCode': result,
if (findingsSummary != null) 'findings': findingsSummary,
},
);

/// Provides information about the plugins injected into an iOS or macOS
/// project.
///
Expand Down
2 changes: 1 addition & 1 deletion pkgs/unified_analytics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
# LINT.IfChange
# When updating this, keep the version consistent with the changelog and the
# value in lib/src/constants.dart.
version: 8.0.3
version: 8.0.4
# LINT.ThenChange(lib/src/constants.dart)
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics
issue_tracker: https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aunified_analytics
Expand Down
44 changes: 44 additions & 0 deletions pkgs/unified_analytics/test/event_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,50 @@ void main() {
expect(constructedEvent.eventData.length, 4);
});

test('Event.flutterWasmDryRun constructed', () {
Event generateEventNoFindings() => Event.flutterWasmDryRun(
result: 'success',
exitCode: 123,
);

final constructedEvent1 = generateEventNoFindings();

expect(generateEventNoFindings, returnsNormally);
expect(constructedEvent1.eventName, DashEvent.flutterWasmDryRun);
expect(constructedEvent1.eventData['result'], 'success');
expect(constructedEvent1.eventData['exitCode'], 123);
expect(constructedEvent1.eventData.length, 2);
});
test('Event.flutterWasmDryRun constructed', () {
Event generateEventNoFindings() => Event.flutterWasmDryRun(
result: 'success',
exitCode: 123,
);

final constructedEvent1 = generateEventNoFindings();

expect(generateEventNoFindings, returnsNormally);
expect(constructedEvent1.eventName, DashEvent.flutterWasmDryRun);
expect(constructedEvent1.eventData['result'], 'success');
expect(constructedEvent1.eventData['exitCode'], 123);
expect(constructedEvent1.eventData.length, 2);

Event generateEventFindings() => Event.flutterWasmDryRun(
result: 'success',
exitCode: 123,
findingsSummary: '1,2,3'
);

final constructedEvent2 = generateEventFindings();

expect(generateEventFindings, returnsNormally);
expect(constructedEvent2.eventName, DashEvent.flutterWasmDryRun);
expect(constructedEvent2.eventData['result'], 'success');
expect(constructedEvent2.eventData['exitCode'], 123);
expect(constructedEvent2.eventData['findingsSummary'], '1,2,3');
expect(constructedEvent2.eventData.length, 3);
});

test('Event.flutterInjectDarwinPlugins constructed', () {
Event generateEvent() => Event.flutterInjectDarwinPlugins(
platform: 'ios',
Expand Down
Loading