Skip to content

Commit

Permalink
Fix abi key for local golden file testing (#148072)
Browse files Browse the repository at this point in the history
  • Loading branch information
Piinks authored May 14, 2024
1 parent e2ef38d commit 4a1e3ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
19 changes: 11 additions & 8 deletions packages/flutter_goldens/lib/skia_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -580,21 +580,24 @@ class SkiaGoldClient {
/// the image keys.
String getTraceID(String testName) {
final String? webRenderer = _webRendererValue;
final Map<String, Object?> keys = <String, Object?>{
final Map<String, Object?> parameters = <String, Object?>{
if (_isBrowserTest)
'Browser' : _browserKey,
if (webRenderer != null)
'WebRenderer' : webRenderer,
'Abi': abi.toString(),
'CI' : 'luci',
'Platform' : platform.operatingSystem,
// 'Abi': abi.toString(), workaround for https://g-issues.skia.org/issues/339508268
// Flutter tracking issue: https://github.com/flutter/flutter/issues/148022
'name' : testName,
'source_type' : 'flutter',
if (webRenderer != null)
'WebRenderer' : webRenderer,
if (_isImpeller)
'impeller': 'swiftshader',
'name' : testName,
'source_type' : 'flutter',
};
final String jsonTrace = json.encode(keys);
final Map<String, Object?> sorted = <String, Object?>{};
for (final String key in parameters.keys.toList()..sort()) {
sorted[key] = parameters[key];
}
final String jsonTrace = json.encode(sorted);
final String md5Sum = md5.convert(utf8.encode(jsonTrace)).toString();
return md5Sum;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_goldens/test/flutter_goldens_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void main() {

expect(
skiaClient.getTraceID('flutter.golden.1'),
equals('ae18c7a6aa48e0685525dfe8fdf79003'),
equals('d8867d66b8f0be8d0c31598d8370f5dd'),
);
});

Expand Down Expand Up @@ -533,7 +533,7 @@ void main() {

expect(
skiaClient.getTraceID('flutter.golden.1'),
equals('e9d5c296c48e7126808520e9cc191243'),
equals('febd0e8ef6512c2a82c964b2a9e60012'),
);
});

Expand Down Expand Up @@ -561,7 +561,7 @@ void main() {
);
expect(
skiaClient.getTraceID('flutter.golden.1'),
equals('9968695b9ae78cdb77cbb2be621ca2d6'),
equals('2e3d3f41cb4470748fa1c941f7762823'),
);
});

Expand Down

0 comments on commit 4a1e3ea

Please sign in to comment.