Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

add option for bulk-updating screenshots; update screenshots #12797

Merged
merged 6 commits into from
Oct 4, 2019

Conversation

yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Oct 4, 2019

You can now run felt test --update-screenshot-goldens to update screenshots. This option composes with other felt test options.

@yjbanov yjbanov requested review from ditman, mdebbar and ferhatb October 4, 2019 17:55
@yjbanov yjbanov added the Work in progress (WIP) Not ready (yet) for review! label Oct 4, 2019
@yjbanov
Copy link
Contributor Author

yjbanov commented Oct 4, 2019

Marking as WIP because it depends on flutter/goldens#51

Copy link
Member

@ditman ditman left a 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!

p.fromUri(await Isolate.resolvePackageUri(
Uri.parse('package:test/src/runner/browser/static/favicon.ico'))),
root: root,
isUpdateScreenshotGoldens: isUpdateScreenshotGoldens,
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

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)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to bool updateScreenshotGoldens

Copy link
Contributor Author

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.

Copy link
Contributor Author

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 :)

Copy link
Contributor

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldYouBeSoKindToUpdateScreenshotGoldens :trollface:

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'];
Copy link
Member

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!)

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@yjbanov
Copy link
Contributor Author

yjbanov commented Oct 4, 2019

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();
Copy link
Contributor

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());
Copy link
Member

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)

Copy link
Member

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!

@yjbanov
Copy link
Contributor Author

yjbanov commented Oct 4, 2019

Landing on red LUCI. The LUCI failure is Android AOT on Windows, which is unrelated to this change.

@yjbanov yjbanov merged commit bba0065 into flutter:master Oct 4, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Oct 8, 2019
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
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Work in progress (WIP) Not ready (yet) for review!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants