Closed Bug 1054326 Opened 12 years ago Closed 11 years ago

Add image comparison framework to gaiatest

Categories

(Remote Protocol :: Marionette, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: njpark, Assigned: njpark)

Details

(Whiteboard: fxosqa-auto-s4 [affects=gaia])

Attachments

(1 external file, 6 obsolete files)

Assignee: nobody → npark
initial pull request: https://github.com/mozilla-b2g/gaia/pull/23043 I couldn't find the review flag option. Let me know if this isn't the proper way.
Flags: needinfo?(dave.hunt)
You need to attach a patch and the review flag becomes available for that attachment. For github pull requests you can use https://github.com/autonome/Github-Bugzilla-Tweaks.
Flags: needinfo?(dave.hunt)
Status: NEW → ASSIGNED
I've had a quick look over and this looks in pretty good shape. Before I do a thorough review I think it's worth discussing the value of landing this in the main gaia repository, especially considering the recent reorganisation. I will still be happy to review your code, even if it's decided that it should remain in your fork or in a separate repository. The bug may not be the best place to have this discussion, but for now let's needinfo :tchung and :lightsofapollo for their thoughts.
Status: ASSIGNED → NEW
Flags: needinfo?(tchung)
Flags: needinfo?(jlal)
Status: NEW → ASSIGNED
If we decide to keep it in a separate repo, for the users of this tool, would there be a easy way to update gaiatest and python test cases by somehow remote linking to the main gaia repo? Or should they do git fetch upstream each time? It would be nice if they do a git pull here it'll also fetch the latest gaiatest and test cases. If that's possible then maybe we do not need to merge it back to the main tree. ni?ing Dave for more info.
Flags: needinfo?(dave.hunt)
If this was maintained separately there are a few options, some are below: 1. It could depend on the released version of gaiatest available on PyPI at https://pypi.python.org/pypi/gaiatest which is periodically released from the master branch. 2. Like you suggest, the user could maintain a local gaia repository for installing the gaiatest package. 3. We could add a submodule for the gaia project. Of the above I would favour option 1, and my least favourite option is 3, as it increases maintenance and the gaia repo is pretty big to have as a submodule. Could you tell me what users are currently running the image comparison tests (or the intended users), and I'm also interested to know if you've found any genuine regressions so far. Do the tests generate much noise and false positives?
Flags: needinfo?(dave.hunt) → needinfo?(npark)
(In reply to Dave Hunt (:davehunt) from comment #6) > If this was maintained separately there are a few options, some are below: > > 1. It could depend on the released version of gaiatest available on PyPI at > https://pypi.python.org/pypi/gaiatest which is periodically released from > the master branch. > 2. Like you suggest, the user could maintain a local gaia repository for > installing the gaiatest package. > 3. We could add a submodule for the gaia project. > > Of the above I would favour option 1, and my least favourite option is 3, as > it increases maintenance and the gaia repo is pretty big to have as a > submodule. > > Could you tell me what users are currently running the image comparison > tests (or the intended users), and I'm also interested to know if you've > found any genuine regressions so far. Do the tests generate much noise and > false positives? So I played around with fuzz value of imagemagick, and found out with 5% fuzz factor, it picks out differences about 9 out of 10 times. Most cases, false positives occur when rendering large images in gallery app. But even in this case, you know it right away because typical pixel differences are about > 10000, but in case of false positive it's around 3000 ~ 4000. I think even with fuzz factor value of 10 to 15%, there is no risk of producing false negatives (which I'll play around with) I should mention that with 0% fuzz factor, you see false positives about 8 out of 10 times, especially with browser and gallery. While running this tool continuously in month of July, I think found about 2~3 graphical regression issues in master branch, although I did spend about 30 minutes each for investigating the failure causes. For now, it is mainly developed for me to efficiently pick out obvious graphics regression, but anyone can use it to detect UI regressions or unannounced UI changes. For example, new 2.1 graphics features include setting entire screen to greyscale mode or inverted color mode (Bug 1016539), and I'm planning to write a script that tests this using this tool.
Flags: needinfo?(npark)
> > fuzz factor, it picks out differences about 9 out of 10 times. Sorry for the confusing words, I meant that when it detected a difference, 9/10 times it was picking out legitimate differences, while 1/0 times it showed false positive.
deferring to Dave (we discussed offline)
Flags: needinfo?(jlal)
Comment on attachment 8475805 [details] [review] Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23043 I think this is unlikely to be merged into the main gaia repository at this time unless there's an overwhelming need for it. I think it will likely be able to serve it's users either from a fork/branch (as it is now) or as a separate project/repo. No-Jun: Let me know if you need any help, and if you'd still like me to review your code.
Attachment #8475805 - Flags: review?(dave.hunt)
Flags: needinfo?(tchung)
(In reply to Dave Hunt (:davehunt) from comment #10) > Comment on attachment 8475805 [details] [review] > Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23043 > > I think this is unlikely to be merged into the main gaia repository at this > time unless there's an overwhelming need for it. I think it will likely be > able to serve it's users either from a fork/branch (as it is now) or as a > separate project/repo. > > No-Jun: Let me know if you need any help, and if you'd still like me to > review your code. Sure it would be great for you to review my code, I think it got a lot more robust after your comments. I will check in some changes this week, and let you know when it's in.
(In reply to Dave Hunt (:davehunt) from comment #6) > If this was maintained separately there are a few options, some are below: > > 1. It could depend on the released version of gaiatest available on PyPI at > https://pypi.python.org/pypi/gaiatest which is periodically released from > the master branch. > 2. Like you suggest, the user could maintain a local gaia repository for > installing the gaiatest package. > 3. We could add a submodule for the gaia project. > > Of the above I would favour option 1, and my least favourite option is 3, as > it increases maintenance and the gaia repo is pretty big to have as a > submodule. > > Could you tell me what users are currently running the image comparison > tests (or the intended users), and I'm also interested to know if you've > found any genuine regressions so far. Do the tests generate much noise and > false positives? Also when you have time, can we discuss how to achieve option #1?
(In reply to No-Jun Park [:njpark] from comment #12) > Also when you have time, can we discuss how to achieve option #1? Sure, ping me on IRC or shoot me an e-mail.
(In reply to Dave Hunt (:davehunt) from comment #10) > Comment on attachment 8475805 [details] [review] > Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23043 > > I think this is unlikely to be merged into the main gaia repository at this > time unless there's an overwhelming need for it. I think it will likely be > able to serve it's users either from a fork/branch (as it is now) or as a > separate project/repo. > > No-Jun: Let me know if you need any help, and if you'd still like me to > review your code. Sorry for the missed NI. there's no overwhelming need, but there's still a need for us to catch the often and incoming graphics bugs that seem to appear every release of b2g. running this in main gaia would hopefully catch those issues sooner than later, especially with the upcoming per commit device builds against tree herder. So maybe i missed it, but what is holding us back from incorporating this work into main Gaia? is it a large technical challenge and time consumption? We're also open to ideas if running the tests locally but submitting the test results for everyone to see is a achievable goal.
Flags: needinfo?(dave.hunt)
I don't think having this in a separate repository prevents us from having any of the things you mention. At the end of the day it's just where the code is located.
Flags: needinfo?(dave.hunt)
Hi Dave, this is my re-attempt to merge this branch into master. I ran try a few times, and it seems that it has intermittent failures unrelated to my change. I have a lot of commits here, and if you need me to squash it or create a new branch and fresh-include my changes, let me know. Files that are relevant for this review is: gaiatest/gaia_graphics_test.py gaiatest/runtests.py gaiatest/mixins/imagecompare.py and the contents in gaiatest/tests/graphics
Attachment #8521749 - Flags: review?(dave.hunt)
Last two try runs seem clean to me.
Attachment #8521749 - Attachment description: Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26076 → Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26159
Attachment #8521749 - Flags: review?(dave.hunt)
Whiteboard: fxosqa-auto-s4
Comment on attachment 8523131 [details] [review] Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26159 I've added comments in the pull request.
Attachment #8523131 - Flags: review?(dave.hunt) → review-
Attachment #8521749 - Attachment is obsolete: true
Attachment #8475805 - Attachment is obsolete: true
2nd round of review - again, thank you for looking Dave!
Attachment #8529271 - Flags: review?(dave.hunt)
Whiteboard: fxosqa-auto-s4 → fxosqa-auto-s4 [affects=gaia]
Comment on attachment 8529271 [details] Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26159 Some fantastic improvements over the last patch. I've added more comments in the pull request, and suspect our next review loop will be in person in Portland. :)
Attachment #8529271 - Attachment description: Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26159/commits → Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26159
Attachment #8529271 - Flags: review?(dave.hunt) → review-
Attachment #8529271 - Attachment mime type: text/plain → text/x-github-pull-request
Attachment #8523131 - Attachment is obsolete: true
another round
Attachment #8529271 - Attachment is obsolete: true
Attachment #8530088 - Flags: review?(dave.hunt)
Comment on attachment 8530088 [details] Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26159/commits We set down in Portland and went through the patch. Let me know when it's ready for review again. :)
Attachment #8530088 - Flags: review?(dave.hunt)
Changes incorporated, and light cleanup was done. let me know if it's good to squash commits.
Attachment #8530088 - Attachment is obsolete: true
Attachment #8533515 - Flags: review?(dave.hunt)
Actually I squashed the commits.
Comment on attachment 8533515 [details] [review] Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26159 Let's do one more round because I think there are some copy/paste issues. Make sure you only connect to WiFi if a test needs a WiFi connection. Otherwise if any connection is needed use connect_to_local_area_network (this will work on desktop). Also remove any setUp/tearDown methods that only call the parent method as this is done through inheritance. Finally I have the following comments that will not block us landing this. It's already proving to be able to run on Jenkins, so I'm keen to get this landed and you can continue to make improvements as you see fit: * Check everything with PEP 8 (I saw some file line ending issues, and spaces missing after commas, etc) * We could gather screenshots throughout the tests into a list and then do all the comparison at the end. This might make reporting easier. * It would be great to generate a custom report with the screenshot, reference, and diff images on failure. * It would be best to use/extend the app objects instead of having locators in the tests.
Attachment #8533515 - Flags: review?(dave.hunt) → review-
Hi Dave, I cleaned up the scripts, but left the use of private locators, since I didn't want to massively update app codes. Could you take a look again please? Thanks!
Attachment #8556664 - Flags: review?(dave.hunt)
Attachment #8533515 - Attachment is obsolete: true
Attachment #8556664 - Flags: review?(dave.hunt) → review+
I've also updated the Jenkins jobs to use the mozilla-b2g/gaia repository and master branch.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Thanks a lot for all your work! just to let you know, I'm regularly monitoring the results once every 1-2 days, and will continue to do so as mentioned before. Will create new bugs in near future when I find the allocation to incorporate your suggestions in Comment 28.
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: