-
Notifications
You must be signed in to change notification settings - Fork 6k
add option for bulk-updating screenshots; update screenshots #12797
Conversation
Marking as WIP because it depends on flutter/goldens#51 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing this, very useful!
lib/web_ui/dev/test_platform.dart
Outdated
p.fromUri(await Isolate.resolvePackageUri( | ||
Uri.parse('package:test/src/runner/browser/static/favicon.ico'))), | ||
root: root, | ||
isUpdateScreenshotGoldens: isUpdateScreenshotGoldens, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know about the styleguide but... shouldUpdateScreenshotGoldens
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should
could mean there's possibility that it won't update anything. How about doUpdateScreenshotGoldens
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to limit to [is
, has
, can
, should
], but yeah, doUpdateScreenshotGoldens
or even just updateScreenshotGoldens
sounds a little bit better (to me)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to bool updateScreenshotGoldens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateScreenshotGoldens
sounds too much like a method name. I'll go with do
. I think anything that sounds like a statement that could be true or false is OK. is, has, can, should, did, was, must, all sound fine to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I draw the line on archaisms though. shallWeUpdateScreenshotGoldens
is a no-go :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know my comment isn't helping, it's only adding to the bike-shedding. But doUpdateScreenshotGoldens
still sounds like a method name to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldYouBeSoKindToUpdateScreenshotGoldens
lib/web_ui/dev/test_runner.dart
Outdated
final String destinationAhemTtfPath = | ||
path.join(environment.webUiRootDir.path, 'lib', 'assets', 'ahem.ttf'); | ||
sourceAhemTtf.copySync(destinationAhemTtfPath); | ||
const List<String> _kTestFonts = <String>['ahem.ttf', 'Roboto-Light.ttf']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roboto Light is quite thin, so this has a small risk of having extra antialias problems (but it'll be a cool test for the fuzzy comparison!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason I thought light was the default. Strangely the tests passed locally. I would expect them to fail if I picked a wrong font. Trying Roboto-Regular
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, it would help if the smoke test used the Flutter engine at all! LOL. Fixing.
I switched to a bundled Roboto and to flutter/golden master. Will land on green unless told otherwise. |
@@ -47,7 +54,7 @@ class TestsCommand extends Command<bool> { | |||
Future<bool> run() async { | |||
Chrome.version = chromeVersion; | |||
|
|||
_copyAhemFontIntoWebUi(); | |||
_copyTestFontsIntoWebUi(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
void main() { | ||
void main() async { | ||
debugEmulateFlutterTesterEnvironment = true; | ||
await webOnlyInitializePlatform(assetManager: WebOnlyMockAssetManager()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I guess there's some styles in the platform init that causes the color of the font to become red)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the above, LGTM!
Landing on red LUCI. The LUCI failure is Android AOT on Windows, which is unrelated to this change. |
git@github.com:flutter/engine.git/compare/1d62160fdb2f...4a849e0 git log 1d62160..4a849e0 --no-merges --oneline 2019-10-08 dnfield@google.com Color matrix doc (flutter/engine#12982) 2019-10-07 jason-simmons@users.noreply.github.com Use the standard gen_snapshot target unless the platform requires host_targeting_host (flutter/engine#12988) 2019-10-07 bkonyi@google.com Roll src/third_party/dart 8413a0db0d..8ba6f7e2eb (39 commits) (flutter/engine#12981) 2019-10-07 liyuqian@google.com Unblock Fuchsia roll (flutter/engine#12977) 2019-10-06 chinmaygarde@google.com Update buildroot to pull in ubsan updates. (flutter/engine#12821) 2019-10-05 skia-flutter-autoroll@skia.org Roll src/third_party/skia 95edac1c9a4a..4c82a9fc83a5 (13 commits) (flutter/engine#12818) 2019-10-05 chinmaygarde@google.com Enable sanitizer build variants. (flutter/engine#12816) 2019-10-05 katelovett@google.com Revert "Adding Link SemanticsFlag (#12453)" (flutter/engine#12815) 2019-10-04 jason-simmons@users.noreply.github.com Use the x64 host toolchain for x86 target gen_snapshot only on Linux (flutter/engine#12809) 2019-10-04 yjbanov@google.com add option for bulk-updating screenshots; update screenshots (flutter/engine#12797) 2019-10-04 dnfield@google.com unbreak unopt fuchsia (flutter/engine#12805) 2019-10-04 jason-simmons@users.noreply.github.com Build gen_snapshot with a 64-bit host toolchain even if the target platform is 32-bit (flutter/engine#12802) 2019-10-04 dnfield@google.com [flutter_runner] a11y updates, tests! (flutter/engine#12380) 2019-10-04 WATER1350@gmail.com Fix crash in copypixelbuffer (flutter/engine#10326) 2019-10-04 bkonyi@google.com Roll src/third_party/dart d6c6d12ebf..8413a0db0d (2 commits) 2019-10-04 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from JyZWz... to kwa2O... (flutter/engine#12803) 2019-10-04 katelovett@google.com Adding Link SemanticsFlag (flutter/engine#12453) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC liyuqian@google.com on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
git@github.com:flutter/engine.git/compare/1d62160fdb2f...4a849e0 git log 1d62160..4a849e0 --no-merges --oneline 2019-10-08 dnfield@google.com Color matrix doc (flutter/engine#12982) 2019-10-07 jason-simmons@users.noreply.github.com Use the standard gen_snapshot target unless the platform requires host_targeting_host (flutter/engine#12988) 2019-10-07 bkonyi@google.com Roll src/third_party/dart 8413a0db0d..8ba6f7e2eb (39 commits) (flutter/engine#12981) 2019-10-07 liyuqian@google.com Unblock Fuchsia roll (flutter/engine#12977) 2019-10-06 chinmaygarde@google.com Update buildroot to pull in ubsan updates. (flutter/engine#12821) 2019-10-05 skia-flutter-autoroll@skia.org Roll src/third_party/skia 95edac1c9a4a..4c82a9fc83a5 (13 commits) (flutter/engine#12818) 2019-10-05 chinmaygarde@google.com Enable sanitizer build variants. (flutter/engine#12816) 2019-10-05 katelovett@google.com Revert "Adding Link SemanticsFlag (flutter#12453)" (flutter/engine#12815) 2019-10-04 jason-simmons@users.noreply.github.com Use the x64 host toolchain for x86 target gen_snapshot only on Linux (flutter/engine#12809) 2019-10-04 yjbanov@google.com add option for bulk-updating screenshots; update screenshots (flutter/engine#12797) 2019-10-04 dnfield@google.com unbreak unopt fuchsia (flutter/engine#12805) 2019-10-04 jason-simmons@users.noreply.github.com Build gen_snapshot with a 64-bit host toolchain even if the target platform is 32-bit (flutter/engine#12802) 2019-10-04 dnfield@google.com [flutter_runner] a11y updates, tests! (flutter/engine#12380) 2019-10-04 WATER1350@gmail.com Fix crash in copypixelbuffer (flutter/engine#10326) 2019-10-04 bkonyi@google.com Roll src/third_party/dart d6c6d12ebf..8413a0db0d (2 commits) 2019-10-04 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from JyZWz... to kwa2O... (flutter/engine#12803) 2019-10-04 katelovett@google.com Adding Link SemanticsFlag (flutter/engine#12453) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC liyuqian@google.com on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
You can now run
felt test --update-screenshot-goldens
to update screenshots. This option composes with otherfelt test
options.