Closed Bug 1069238 Opened 8 years ago Closed 8 years ago

[Calendar] Failing unit test with newer mocha

Categories

(Firefox OS Graveyard :: Gaia::Calendar, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julienw, Unassigned)

References

Details

Attachments

(1 file)

46 bytes, text/x-github-pull-request
kgrandon
: review+
Details | Review
The newer mocha shows some issues in the calendar tests.

02:22:56     INFO -  TEST-UNEXPECTED-FAIL | calendar/test/unit/controllers/alarm_test.js | Controllers.Alarm "after each" hook: wrapper - TypeError: mockAlarms.onadd is not a function (app://calendar.gaiamobile.org/test/unit/controllers/alarm_test.js?time=1410945775112:121)
02:22:56     INFO -      Error: TypeError: mockAlarms.onadd is not a function (app://calendar.gaiamobile.org/test/unit/controllers/alarm_test.js?time=1410945775112:121)
02:22:56     INFO -          at onerror (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:5738:10)
02:25:06     INFO -  TEST-UNEXPECTED-FAIL | calendar/test/unit/app_test.js | app PendingManager event life-cycle multiple events - Error: expected { app:
02:25:06     INFO -     { PendingManager: [Function: PendingManager],
02:25:06     INFO -       DateL10n:
02:25:06     INFO -        { localizeElements: [Function],
02:25:06     INFO -          changeElementsHourFormat: [Function],
02:25:06     INFO -          localizeElement: [Function] },
02:25:06     INFO -       dateFormat:
02:25:06     INFO -        { localeDateString: [Function: localeDateString],
02:25:06     INFO -          localeTimeString: [Function: localeTimeString],
02:25:06     INFO -          localeString: [Function: localeString],
02:25:06     INFO -          localeFormat: [Function: localeFormat],
02:25:06     INFO -          fromNow: [Function: prettyDate],
02:25:06     INFO -          relativeParts: [Function: relativeParts] },
02:25:06     INFO -       startingURL: 'app://calendar.gaiamobile.org/test/unit/_sandbox.html?time=1410945904690',
02:25:06     INFO -       _location:
02:25:06     INFO -        { href: [Getter/Setter],
02:25:06     INFO -          origin: [Getter],
02:25:06     INFO -          protocol: [Getter/Setter],
02:25:06     INFO -          username: [Getter/Setter],
02:25:06     INFO -          password: [Getter/Setter],
02:25:06     INFO -          host: [Getter/Setter],
02:25:06     INFO -          hostname: [Getter/Setter],
02:25:06     INFO -          port: [Getter/Setter],
02:25:06     INFO -          pathname: [Getter/Setter],
02:25:06     INFO -          search: [Getter/Setter],
02:25:06     INFO -          searchParams: [Getter/Setter],
02:25:06     INFO -          hash: [Getter/Setter],
02:25:06     INFO -          assign: [Function: assign],
02:25:06     INFO -          replace: [Function: replace],
02:25:06     INFO -          reload: [Function: reload],
02:25:06     INFO -          toString: [Function: toString],
02:25:06     INFO -          valueOf: [Function: valueOf],
02:25:06     INFO -          toJSON: undefined },
02:25:06     INFO -       _mozTimeRefreshTimeout: 3000,
02:25:06     INFO -       pendingClass: 'pending-operation',
02:25:06     INFO -       configure: [Function],
02:25:06     INFO -       observeDateLocalization: [Function],
02:25:06     INFO -       setCurrentTimeFormat: [Function],
02:25:06     INFO -       observePendingObject: [Function],
02:25:06     INFO -       isPending: [Function],

Skipping 306 lines...

02:25:06     INFO -              _upgradeOperations: [] },
02:25:06     INFO -           router:
02:25:06     INFO -            { page: [Object],
02:25:06     INFO -              _activeObjects: [],
02:25:06     INFO -              start: [Function],
02:25:06     INFO -              stop: [Function],
02:25:06     INFO -              show: [Function],
02:25:06     INFO -              _lastState: [Function] },
02:25:06     INFO -           _providers: {},
02:25:06     INFO -           _views: {},
02:25:06     INFO -           _routeViewFn: {},
02:25:06     INFO -           _pendingManager:
02:25:06     INFO -            { objects: [Object],
02:25:06     INFO -              pending: 0,
02:25:06     INFO -              onstart: [Function],
02:25:06     INFO -              onend: [Function],
02:25:06     INFO -              oncomplete: [Function: onpending],
02:25:06     INFO -              onpending: [Function: oncomplete] },
02:25:06     INFO -           timeController:
02:25:06     INFO -            { app: [Circular],
02:25:06     INFO -              '_$events': {},
02:25:06     INFO -              _timeObservers: [],
02:25:06     INFO -              _timeCache: {},
02:25:06     INFO -              _eventsCache: {},
02:25:06     INFO -              _timespans: [],
02:25:06     INFO -              _collection: [Object],
02:25:06     INFO -              busytime: [Object],
02:25:06     INFO -              calendarStore: [Object] },
02:25:06     INFO -           syncController: { app: [Circular], pending: 0, '_$events': [Object] },
02:25:06     INFO -           serviceController: { _lastId: 0, '_$events': {}, roles: {}, workers: [] },
02:25:06     INFO -           alarmController: { app: [Circular], store: [Object] },
02:25:06     INFO -           errorController: { '_$events': {}, app: [Circular], _handlers: {} } },
02:25:06     INFO -        called: 1,
02:25:06     INFO -        args: { '0': { app: [Object] } },
02:25:06     INFO -        onactive: [Function],
02:25:06     INFO -        oninactive: [Function] } (app://calendar.gaiamobile.org/common/test/helper.js?time=1410945904866:31)
02:25:06     INFO -          at onerror (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:5738:10)
02:25:06     INFO -  TEST-PASS | calendar/test/unit/app_test.js | app PendingManager event life-cycle multiple events
02:25:06     INFO -  TEST-PASS | calendar/test/unit/app_test.js | app #forceRestart redirect to manifest url
02:25:06     INFO -  TEST-PASS | calendar/test/unit/app_test.js | app #forceRestart with pending restart
02:25:06     INFO -  TEST-UNEXPECTED-FAIL | calendar/test/unit/app_test.js | app #forceRestart with pending restart - expected '/xxx' to equal '/xxx'
02:25:06     INFO -      Error: expected '/xxx' to equal '/xxx'
02:25:06     INFO -          at chaiAssert (app://calendar.gaiamobile.org/common/test/helper.js:31:1)
02:25:06     INFO -          at notEqual (app://calendar.gaiamobile.org/common/vendor/chai/chai.js:1271:1)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/test/unit/app_test.js:323:7)
02:25:06     INFO -          at wrapper (app://calendar.gaiamobile.org/common/test/mocha_generators.js:62:19)
02:25:06     INFO -          at run (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4311:7)
02:25:06     INFO -          at runTest (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4728:5)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4806:7)
02:25:06     INFO -          at next (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4653:1)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4663:7)
02:25:06     INFO -          at next (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4601:1)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4625:7)
02:25:06     INFO -          at done (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4300:5)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4314:9)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/test/mocha_generators.js:46:20)
02:25:06     INFO -          at wrapper (app://calendar.gaiamobile.org/common/test/mocha_generators.js:73:15)
02:25:06     INFO -          at run (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4311:7)
02:25:06     INFO -          at next (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4613:5)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4630:5)
02:25:06     INFO -          at timeslice (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:5763:5)
02:25:06     INFO -  TEST-PASS | calendar/test/unit/app_test.js | app #_showTodayDate show current date on the .icon-calendar-today span
02:25:06     INFO -  TEST-PASS | calendar/test/unit/app_test.js | app #_showTodayDate show current date on the .icon-calendar-today span
02:25:06     INFO -  TEST-UNEXPECTED-FAIL | calendar/test/unit/app_test.js | app #_syncTodayDate Update the date on the today span after midnight - expected '7' to equal 8
02:25:06     INFO -      Error: expected '7' to equal 8
02:25:06     INFO -          at chaiAssert (app://calendar.gaiamobile.org/common/test/helper.js:31:1)
02:25:06     INFO -          at equal (app://calendar.gaiamobile.org/common/vendor/chai/chai.js:1245:1)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/test/unit/app_test.js:470:1)
02:25:06     INFO -          at wrapper (app://calendar.gaiamobile.org/common/test/mocha_generators.js:62:19)
02:25:06     INFO -          at run (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4311:7)
02:25:06     INFO -          at runTest (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4728:5)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4806:7)
02:25:06     INFO -          at next (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4653:1)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4663:7)
02:25:06     INFO -          at next (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4601:1)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4625:7)
02:25:06     INFO -          at done (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4300:5)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4314:9)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/test/mocha_generators.js:46:20)
02:25:06     INFO -          at wrapper (app://calendar.gaiamobile.org/common/test/mocha_generators.js:73:15)
02:25:06     INFO -          at run (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4311:7)
02:25:06     INFO -          at next (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4613:5)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4630:5)
02:25:06     INFO -          at timeslice (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:5763:5)
02:25:06     INFO -  TEST-UNEXPECTED-FAIL | calendar/test/unit/app_test.js | app #_syncTodayDate Update the date on the today span after midnight - expected '7' to equal 8
02:25:06     INFO -      Error: expected '7' to equal 8
02:25:06     INFO -          at chaiAssert (app://calendar.gaiamobile.org/common/test/helper.js:31:1)
02:25:06     INFO -          at equal (app://calendar.gaiamobile.org/common/vendor/chai/chai.js:1245:1)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/test/unit/app_test.js:470:1)
02:25:06     INFO -          at wrapper (app://calendar.gaiamobile.org/common/test/mocha_generators.js:62:19)
02:25:06     INFO -          at run (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4311:7)
02:25:06     INFO -          at runTest (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4728:5)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4806:7)
02:25:06     INFO -          at next (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4653:1)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4663:7)
02:25:06     INFO -          at next (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4601:1)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4625:7)
02:25:06     INFO -          at done (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4300:5)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4314:9)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/test/mocha_generators.js:46:20)
02:25:06     INFO -          at wrapper (app://calendar.gaiamobile.org/common/test/mocha_generators.js:73:15)
02:25:06     INFO -          at run (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4311:7)
02:25:06     INFO -          at next (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4613:5)
02:25:06     INFO -          at (anonymous) (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:4630:5)
02:25:06     INFO -          at timeslice (app://calendar.gaiamobile.org/common/vendor/mocha/mocha.js:5763:5)
02:25:06     INFO -  TEST-OK | calendar/test/unit/app_test.js | took 693ms


The first one is easy to fix but I didn't look the other ones yet
Attached file github PR
WIP
Comment on attachment 8491383 [details] [review]
github PR

I think both of these issues could give intermittents with the current mocha, but this permafails with the new mocha.
Attachment #8491383 - Flags: review?(kgrandon)
Attachment #8491383 - Flags: review?(jlal)
Comment on attachment 8491383 [details] [review]
github PR

Seems fine to me. Feel free to wait for a review from James, or land with my r+. Thanks!
Attachment #8491383 - Flags: review?(kgrandon) → review+
Comment on attachment 8491383 [details] [review]
github PR

Won't bother James for such a small patch, thanks Kevin
Attachment #8491383 - Flags: review?(jlal)
master: f02f06c09f36df1568785f7452557b6884202aa8
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.