Skip to content

Conversation

@blasten
Copy link

@blasten blasten commented Jan 30, 2020

Description

Use Skia golden files in driver test, so we don't need to check in binaries into this repo. To make this happen, I removed the dependency on dart:ui from flutter_test/lib/src/goldens.dart and flutter_test/lib/src/_goldens_io.dart since dart:ui isn't available in the vm.

I filed #49749 to track access to the Skia gold service from LUCI.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@fluttergithubbot fluttergithubbot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Jan 30, 2020
/// may load files from the local file system, whereas others may load files
/// over the network or from a remote repository.
Future<bool> compare(Element element, Size size, Uri golden);
Future<bool> compare(dynamic element, dynamic size, Uri golden);
Copy link
Contributor

Choose a reason for hiding this comment

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

Though its useful for debugging, I don't think this is a good long-term change since we lose type safety on the APIs. I would recommend exploring how you can expose the same logic without changing the existing APIs

Copy link
Author

Choose a reason for hiding this comment

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

maybe instead of having conditional import in this file, it's really up to the caller to either import web or io. That will remove this problem too. WDYT?

Copy link
Author

Choose a reason for hiding this comment

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

done. PTAL

@blasten blasten force-pushed the skia_gold_driver_test branch from badc669 to 60b2455 Compare January 30, 2020 01:52
@blasten blasten requested a review from jonahwilliams January 30, 2020 01:53
@blasten blasten force-pushed the skia_gold_driver_test branch from 60b2455 to 4223e89 Compare January 30, 2020 01:54
@Piinks
Copy link
Contributor

Piinks commented Jan 30, 2020

Taking a look now, I've updated #49749 regarding authenticating Gold in the Luci environment, goldctl has a luci auth method that does not require a service account.

fyi @kjlubick :)

@Piinks
Copy link
Contributor

Piinks commented Jan 30, 2020

This is going to be great to have tests running on device. Thank you! 🙂 These driver tests are executed in post-submit, right?

I am curious about a few things here. First, I'd like to check which comparator is being used when these run. Right now there are couple of different comparators that may or may not be using Gold based on where/when the test is running. See

if (FlutterSkiaGoldFileComparator.isAvailableForEnvironment(platform)) {

Second, right now the skia gold/post-submit comparator will not return a negative test result, since we don't want to turn the tree red just for an intentional change.

(I think this can actually be changed now since we are checking in golden files in pre-submit with tryjobs.)

If a change lands on master for these driver tests, what do we want to have happen? We won't know about it until it lands, because we aren't running pre-submit checks, so do we want the tree to turn red? Do we want to leave it green, but receive a comment on the PR that landed the change?

Before we decided to check in files in pre-submit, I had considered adding a benchmark for un-triaged results on master to bring them to our attention when they land. WDYT?

@blasten
Copy link
Author

blasten commented Jan 30, 2020

Thanks for the summary @Piinks!

My understanding is that we will start running presubmit tests on LUCI. (Some tests currently run on LUCI if someone adds the tag CQ+1 to a PR)

That said, I think it would make sense to follow the same procedure as any other golden test.

In the meanwhile, (for testing only) I can manually update the golden files.

wdyt?

@Piinks
Copy link
Contributor

Piinks commented Jan 30, 2020

That SGTM. :) If we are getting ready to make the switch to luci for pre-submit, we'll just need to make a few changes to the cirrus-specific aspects of the goldenFileComparator. IIRC, right now for luci it just defers to the local comparator. I'm looking into some of that now, maybe we can touch base when I am back in-office next week? :)

@blasten
Copy link
Author

blasten commented Jan 30, 2020

Perfect. In the meanwhile, would you mind reviewing this PR, so once the changes land we can start testing the LUCI flow? I can manually update the golden files from a LUCI machine.

return null;
}
try {
final bool success = await goldenFileComparator.compare(buffer, testNameUri);
Copy link
Contributor

Choose a reason for hiding this comment

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

You mentioned handling this manually until the client is ready for luci testing. It looks like in post-submit on luci this comparison is a no-op:

return platform.environment.containsKey('SWARMING_TASK_ID')

Copy link
Author

Choose a reason for hiding this comment

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

Yep. I can definitely follow up with that based on the discussion on #49749.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. Is this an already existing test? If so, idk if changing it to a no-op test in the interim is a good idea.

@Piinks
Copy link
Contributor

Piinks commented Jan 30, 2020

Also, is goldctl available on luci? Currently we download the binary for Cirrus testing on mac and windows, and it is in the docker file for linux tests.

@kjlubick
Copy link
Contributor

Yes, goldctl is available from CIPD https://chrome-infra-packages.appspot.com/p/skia/tools/goldctl

@blasten blasten requested a review from Piinks January 30, 2020 20:31
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

The larger re-factoring LGTM, but I don't know if we want to temporarily skip the actual test that this is being refactored for while we circle back to update the skia client/comparator.

return null;
}
try {
final bool success = await goldenFileComparator.compare(buffer, testNameUri);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. Is this an already existing test? If so, idk if changing it to a no-op test in the interim is a good idea.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Touched base with @blasten offline regarding the no-op tests. The pre-existing one will be restored and the new one will be no-op while we stand up the luci support to connect it to.

@blasten blasten requested a review from Piinks January 30, 2020 22:49
@blasten
Copy link
Author

blasten commented Jan 30, 2020

@Piinks PTAL

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

LGTM! :)


The test currently only runs on device lab ["mac/ios"] which runs the app on iPhone 6s.
* Device Lab which runs the app on iPhone 6s.
* LUCI which runs the app on a Fuchsia NUC device.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note to remember as we make the follow-up changes to this, we should see if adding device and environment parameters from these test environments will be beneficial for indexing device lab tests on Gold.
e.g.

/// Returns a JSON String with keys value pairs used to uniquely identify the

I may incorporate it into #49815

@blasten blasten merged commit a50743f into flutter:master Jan 31, 2020
@blasten blasten deleted the skia_gold_driver_test branch January 31, 2020 19:05
@blasten blasten restored the skia_gold_driver_test branch January 31, 2020 19:28
@blasten blasten deleted the skia_gold_driver_test branch January 31, 2020 19:28
blasten pushed a commit that referenced this pull request Jan 31, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: tests "flutter test", flutter_test, or one of our tests c: contributor-productivity Team-specific productivity, code health, technical debt. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants