Closed
Bug 1054326
Opened 12 years ago
Closed 11 years ago
Add image comparison framework to gaiatest
Categories
(Remote Protocol :: Marionette, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: njpark, Assigned: njpark)
Details
(Whiteboard: fxosqa-auto-s4 [affects=gaia])
Attachments
(1 external file, 6 obsolete files)
Placeholder bug to add python codes that uses ImageMagick console app to compare images in gaiatest
Wiki:
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/Run_ImageMagick_Tool_with_Python_Marionette
Github page:
https://github.com/npark-mozilla/gaia/tree/ImageCompare
Maintenance plan, including graphics testing plan:
https://wiki.mozilla.org/B2G/QA/Device_Test_Plan/Graphics#Image_comparison_library_to_Python_Marionette_Framework
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → npark
| Assignee | ||
Comment 1•12 years ago
|
||
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)
Comment 2•12 years ago
|
||
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)
Comment 3•12 years ago
|
||
Attachment #8475805 -
Flags: review?(dave.hunt)
Updated•12 years ago
|
Status: NEW → ASSIGNED
Comment 4•12 years ago
|
||
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)
Updated•12 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 5•12 years ago
|
||
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)
Comment 6•12 years ago
|
||
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)
| Assignee | ||
Comment 7•12 years ago
|
||
(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)
| Assignee | ||
Comment 8•12 years ago
|
||
>
> 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.
Comment 10•12 years ago
|
||
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)
| Assignee | ||
Comment 11•12 years ago
|
||
(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.
| Assignee | ||
Comment 12•12 years ago
|
||
(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?
Comment 13•12 years ago
|
||
(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.
Comment 14•12 years ago
|
||
(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)
Comment 15•12 years ago
|
||
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)
| Assignee | ||
Comment 16•11 years ago
|
||
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)
| Assignee | ||
Comment 17•11 years ago
|
||
Last two try runs seem clean to me.
| Assignee | ||
Comment 18•11 years ago
|
||
Attachment #8523131 -
Flags: review?(dave.hunt)
| Assignee | ||
Updated•11 years ago
|
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)
| Assignee | ||
Updated•11 years ago
|
Whiteboard: fxosqa-auto-s4
Comment 19•11 years ago
|
||
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-
Updated•11 years ago
|
Attachment #8521749 -
Attachment is obsolete: true
Updated•11 years ago
|
Attachment #8475805 -
Attachment is obsolete: true
| Assignee | ||
Comment 20•11 years ago
|
||
2nd round of review - again, thank you for looking Dave!
Attachment #8529271 -
Flags: review?(dave.hunt)
Updated•11 years ago
|
Whiteboard: fxosqa-auto-s4 → fxosqa-auto-s4 [affects=gaia]
Comment 21•11 years ago
|
||
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-
Updated•11 years ago
|
Attachment #8529271 -
Attachment mime type: text/plain → text/x-github-pull-request
Updated•11 years ago
|
Attachment #8523131 -
Attachment is obsolete: true
Comment 22•11 years ago
|
||
Comment on attachment 8529271 [details]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26159
https://github.com/mozilla-b2g/gaia/pull/26159
| Assignee | ||
Comment 23•11 years ago
|
||
another round
Attachment #8529271 -
Attachment is obsolete: true
Attachment #8530088 -
Flags: review?(dave.hunt)
Comment 24•11 years ago
|
||
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)
| Assignee | ||
Comment 25•11 years ago
|
||
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)
| Assignee | ||
Comment 26•11 years ago
|
||
Actually I squashed the commits.
| Assignee | ||
Comment 27•11 years ago
|
||
Comment 28•11 years ago
|
||
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-
| Assignee | ||
Comment 29•11 years ago
|
||
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)
Updated•11 years ago
|
Attachment #8533515 -
Attachment is obsolete: true
Comment 30•11 years ago
|
||
Comment on attachment 8556664 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26159
Looks good, thanks No-Jun! Rebased, squashed, and merged:
https://github.com/mozilla-b2g/gaia/commit/b0f799a5de174ce11b5958748daf815313022632
Attachment #8556664 -
Flags: review?(dave.hunt) → review+
Comment 31•11 years ago
|
||
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
| Assignee | ||
Comment 32•11 years ago
|
||
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.
Updated•3 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•