Closed
Bug 909631
Opened 11 years ago
Closed 11 years ago
Renable Everything me test (fails in ci)
Categories
(Firefox OS Graveyard :: Gaia::Homescreen, defect)
Firefox OS Graveyard
Gaia::Homescreen
Tracking
(blocking-b2g:-)
RESOLVED
FIXED
blocking-b2g | - |
People
(Reporter: jlal, Assigned: evyatar)
References
Details
Attachments
(1 file)
No description provided.
Reporter | ||
Comment 1•11 years ago
|
||
https://travis-ci.org/mozilla-b2g/gaia/builds/10650421#L210
Reporter | ||
Updated•11 years ago
|
Flags: needinfo?(crdlc)
Reporter | ||
Updated•11 years ago
|
Summary: Everything me test fails in ci → Renable Everything me test (fails in ci)
Comment 2•11 years ago
|
||
Please Evyatar, could you take a look to this bug?, it is failing after landing the migration feature
Flags: needinfo?(crdlc) → needinfo?(evyatar)
Assignee | ||
Comment 3•11 years ago
|
||
It fails on the "asyncStorage" object, even though it's included in the homescreen's index.html. it works well when building - any idea what the test does differently? including async_storage: https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/index.html#L18 including everything.me.js: https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/index.html#L38 the JS line: https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/everything.me/js/everything.me.js#L196
Flags: needinfo?(evyatar)
Comment 4•11 years ago
|
||
Yep, but it is not included on test file https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/test/unit/everything.me_test.js For example you can take a look to contacts how the asyncStorage is a mock for testing https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/contacts/test/unit/link_test.js
Assignee | ||
Comment 5•11 years ago
|
||
so I should copy the mock_asyncStorage into the homescreen's test folder, and include it in everything.me's test JS? just noting - this means that the "keys" will always be empty so this function won't "really" run. can I add demo values in my mock file?
Comment 6•11 years ago
|
||
Yes, you can add to your mock what you want and test it. If it is empty, really the function doesn't run and test shouldn't fail neither. Although if you add some key you can test the behavior of your algorithm as well. Thanks
Assignee | ||
Comment 7•11 years ago
|
||
should I mock the "localStorage" as well? or is that built in?
Comment 8•11 years ago
|
||
The mock could be like this, forget localStorage, right? or do you need to mock localStorage for something? https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/contacts/test/unit/mock_asyncstorage.js
Assignee | ||
Comment 9•11 years ago
|
||
if I just create this it would work - but it won't do anything. I want to force some stuff into the localStorage, but the method to actually run.
Comment 10•11 years ago
|
||
At the beginning of the test you can add MockasyncStorage.keys = { 'blabla' : 'aaaa', 'blabla' : 'bbbb' }; At the end reset if by default MockasyncStorage.keys = {}; So you have a storage filled :)
Assignee | ||
Comment 11•11 years ago
|
||
but I want to add the keys to the localStorage, not the async one :) could I add inside the "suiteSetup" method something like that localStorage["MY KEY"] = "MY VALUE"; or is that not the correct way?
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → evyatar
Comment 12•11 years ago
|
||
yes, you can BUT remember save the original localStorage in the suiteSetup and restore this one in the suiteTeardown For example mocking elementFromPoint from DOM suite('blabla.js >', function() { var realElementFromPoint; suiteSetup(function() { realElementFromPoint = HTMLDocument.prototype.elementFromPoint; }); suiteTeardown(function() { HTMLDocument.prototype.elementFromPoint = realElementFromPoint; }); test('My test ', function() { HTMLDocument.prototype.elementFromPoint = function() { return {x: 0, y: 0}; }; // Do something }); }
Assignee | ||
Comment 13•11 years ago
|
||
Attachment #795969 -
Flags: review?(crdlc)
Comment 14•11 years ago
|
||
Comment on attachment 795969 [details]
Patch - redirect to github PR
Great work as usual! thanks
Attachment #795969 -
Flags: review?(crdlc) → review+
Comment 15•11 years ago
|
||
https://github.com/mozilla-b2g/gaia/commit/babd62446049592fb912aec0025c33a871979761
Status: NEW → RESOLVED
blocking-b2g: --- → leo?
Closed: 11 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 16•11 years ago
|
||
adding leo since the original ticket 907160 also has leo+
Comment 18•11 years ago
|
||
If this doesn't fix a real bug, I don't think we want to include this in 1.1. Unit tests are (unfortunately) not passing in 1.1 for a long time anyway.
Comment 19•11 years ago
|
||
We discussed this during triage today and the consensus was that it didn't meet the criteria for what should block 1.1: https://wiki.mozilla.org/B2G/Triage#Issues_that_Should_Block Obviously if you disagree please renom with some comments :)
blocking-b2g: leo? → -
You need to log in
before you can comment on or make changes to this bug.
Description
•