-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Use skia golden files in driver test #49750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| /// 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); |
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.
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
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.
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?
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.
done. PTAL
badc669 to
60b2455
Compare
60b2455 to
4223e89
Compare
|
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
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.
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? |
|
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? |
|
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? :) |
|
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); |
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.
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') |
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.
Yep. I can definitely follow up with that based on the discussion on #49749.
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.
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.
|
Also, is |
|
Yes, goldctl is available from CIPD https://chrome-infra-packages.appspot.com/p/skia/tools/goldctl |
Piinks
left a comment
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.
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); |
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.
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
left a comment
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.
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.
dev/integration_tests/flutter_driver_screenshot_test/test_driver/main_test.dart
Outdated
Show resolved
Hide resolved
|
@Piinks PTAL |
Piinks
left a comment
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.
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. |
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.
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
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:uifromflutter_test/lib/src/goldens.dartandflutter_test/lib/src/_goldens_io.dartsincedart:uiisn'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.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.