You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove abi key permanently from golden file testing (#149858)
We have fiddled with this a bunch, and there is definitively no way to reliably include this, so I am removing it.
Since CI does not cover all possible values, we can't consistently look up images for local testing. We thought removing it from the look up would work fine, and it did for most tests, but there were still some that could not find an image without it.
A brief history on the abi key
- added in flutter/flutter#143621
- disabled in flutter/flutter#148023
- added back in flutter/flutter#148072
- we thought there was only an issue with alphabetizing keys
- removed from local image look up in flutter/flutter#149696
I updated the docs page to also discuss what makes a good key and what does not based on what we learned here.
Copy file name to clipboardExpand all lines: docs/contributing/testing/Writing-a-golden-file-test-for-package-flutter.md
+20
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
# Writing a golden file test for package:flutter
2
+
1
3
_(This page is referenced by comments in the Flutter codebase.)_
2
4
3
5
**If you want to learn how to write a golden test for your package, see [the `matchesGoldenFile` API docs](https://api.flutter.dev/flutter/flutter_test/matchesGoldenFile.html).** This wiki page describes the special process specifically for the Flutter team itself.
@@ -8,6 +10,7 @@ Golden file tests for `package:flutter` use [Flutter Gold](https://flutter-gold.
8
10
-[Known Issues](#known-issues)
9
11
-[Build Breakage](#build-breakage)
10
12
-[Creating a New Golden File Test](#creating-a-new-golden-file-test)
13
+
-[Adding a new key in the Skia Client](#Adding-a-new-key-in-the-Skia-Client)
11
14
-[Updating a Golden File Test](#updating-a-golden-file-test)
12
15
-[Flutter Gold Login](#flutter-gold-login)
13
16
-[`flutter-gold` Check](#flutter-gold-check)
@@ -76,6 +79,23 @@ New tests can be triaged from these tryjobs, which will cause the pending `flutt
76
79
77
80
And that’s it! Your new golden file(s) will be checked in as the baseline(s) for your new test(s), and your PR will be ready to merge. :tada:
78
81
82
+
## Adding a new key in the Skia Client
83
+
84
+
Approved golden file images on the [Flutter Gold Dashboard][Flutter Gold](https://flutter-gold.skia.org/?query=source_type%3Dflutter)
85
+
are keyed with parameters like platform, CI environment, test name, browser, and image extension.
86
+
87
+
When adding new keys, consider all possible values, and whether or not they are covered by the CI environments that are used
88
+
to test changes in presubmit and postsubmit testing. If not all possible values are accounted for, false negatives can occur
89
+
in local testing.
90
+
91
+
For example, we once included an abi key, which in our CI environments at the time could be linux_x64, windows_x64, or mac_x64.
92
+
These keys are used to look up approved images for local testing, so when a mac_arm64 machine would run local tests,
93
+
no image could be found and the tests would fail.
94
+
Omitting the key in the lookup did most often find the right image, but it was not consistently reliable, so we removed it.
95
+
96
+
If the CI environments available for testing changes do not cover all value of a particular key, it is not a good key to
97
+
include as part of testing.
98
+
79
99
## Updating a Golden File Test
80
100
81
101
If renderings change, then the golden baseline in [Flutter Gold](https://flutter-gold.skia.org/?query=source_type%3Dflutter) will need to be updated.
0 commit comments