Closed Bug 887914 Opened 11 years ago Closed 10 years ago

Unit tests execute all top-level code before any test cases

Categories

(Add-on SDK Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bkase, Assigned: evold)

References

Details

Attachments

(2 files, 2 obsolete files)

Attached file test-a.js (obsolete) —
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0 (Beta/Release)
Build ID: 20130605070403

Steps to reproduce:

Made two test files in a simple add-on, and ran `cfx test`.


Actual results:

info: testbug: Top of file A
info: testbug: Top of file B
info: testbug: In test case, file A
info: testbug: In test case, file B


Expected results:

info: testbug: Top of file A
info: testbug: In test case, file A
info: testbug: Top of file B
info: testbug: In test case, file B
Attached file test-b.js (obsolete) —
Can you attach a zip of your entire addon's source files and tests?
Flags: needinfo?(bkase)
Priority: -- → P2
Attached file Zip of entire addon
Attachment #768448 - Attachment is obsolete: true
Attachment #768452 - Attachment is obsolete: true
Flags: needinfo?(bkase)
Irakli, could you take a look at this?
Flags: needinfo?(rFobic)
Yes it looks like we do search and pre-load tests before running them:
https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/deprecated/unit-test-finder.js

We could fix that, probably by rewriting test runner which would be actually very useful since it's quite a mess right now, although I'm little scared to do it since
it may have some surprising effects on our test.
Flags: needinfo?(rFobic)
Assignee: nobody → evold
Attachment #8484108 - Flags: review?(jsantell) → review+
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/5debe86c8793461316b4d974e6fb6677998689e4
Bug 887914 - Unit tests execute all top-level code before any test cases

https://github.com/mozilla/addon-sdk/commit/4969ab4a5da342956d840dcf35d383aabcffb8f2
Merge pull request #1611 from erikvold/887914v2

Bug 887914 - Unit tests execute all top-level code before any test cases r=@jsantell
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/912cc917d05fd06802894415c8d473eac32f228d
Revert "Bug 887914 - Unit tests execute all top-level code before any test cases"

https://github.com/mozilla/addon-sdk/commit/ec7a6c1259d7d3ccd9539370909fb14996bd6be5
Merge pull request #1614 from mozilla/revert-1611-887914v2

Revert "Bug 887914 - Unit tests execute all top-level code before any test cases"
Flags: needinfo?(evold)
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/cc3242d1ca8cf56314cc81289f85985f6e27dc89
Bug 887914 - Unit tests execute all top-level code before any test cases r=@jsantell
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(evold)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: