[system] fix and reenable unit tests for update manager

RESOLVED FIXED

Status

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: julienw, Assigned: julienw)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Comment hidden (empty)
(Assignee)

Updated

6 years ago
Assignee: nobody → felash
(Assignee)

Comment 1

6 years ago
Created attachment 733901 [details] [diff] [review]
patch v1

see also https://github.com/mozilla-b2g/gaia/pull/9016

- fix updatable tests and use the new mocks helper
- reenable update tests without any more change as I couldn't make them fail. Feel
free to disable again if this intermittently fails after all.
- fix lockscreen test for various firefox versions
---
 apps/system/test/unit/lockscreen_test.js     |   31 +++++++++-------
 apps/system/test/unit/mocks_helper.js        |   13 ++++++-
 apps/system/test/unit/setup.js               |    5 +++
 apps/system/test/unit/updatable_test.js      |   50 ++++++++++++++------------
 apps/system/test/unit/update_manager_test.js |    8 -----
 5 files changed, 63 insertions(+), 44 deletions(-)
 create mode 100644 apps/system/test/unit/setup.js
Attachment #733901 - Flags: review?(etienne)
Comment on attachment 733901 [details] [diff] [review]
patch v1

Review of attachment 733901 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the nit (singular)

let's give travis some work :)

::: apps/system/test/unit/updatable_test.js
@@ +64,5 @@
>      mockApp = new MockApp();
>      subject = new AppUpdatable(mockApp);
> +
> +    // keeping this line here, we might need to use it again in the future
> +    //subject._mgmt = MockAppsMgmt;

we have a pretty solid test-running env right now, it works well against it so let's remove the dead code/dead comment.

::: apps/system/test/unit/update_manager_test.js
@@ +36,5 @@
>    if (! window[mockName]) {
>      window[mockName] = null;
>    }
>  });
>  

(note that from my tests these tests are indeed deterministicly green now)
Attachment #733901 - Flags: review?(etienne) → review+
(Assignee)

Comment 3

6 years ago
master: 3f9979fe26842d90c01e040f57edb9ff59580766
(Assignee)

Comment 4

6 years ago
Created attachment 734600 [details] [diff] [review]
patch v2

carrying r=etienne
Attachment #733901 - Attachment is obsolete: true
Attachment #734600 - Flags: review+
(Assignee)

Updated

6 years ago
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.