Closed
Bug 791577
Opened 12 years ago
Closed 12 years ago
Support "test addons"
Categories
(Add-on SDK Graveyard :: General, defect, P2)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
1.12
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(1 file)
There is a bunch of features that we do not test, or it is really difficult, for the sole reason that our test framework doesn't allow to do so. For example, localization, we added an hack in cfx in order to avoid shipping test locale files from addon-kit that are here just for tests. We do not test simple-prefs for real as we can't execute tests on a real addon. Tests are run against test-harness addon so that we can test properly any feature related to package.json without writing some python tests. At the end, we need a simple way to run test on a regular addon, without the test-harness thing or any non-regular startup process or environnement. In the following pull request, here is the implementation of what I had in mind long time ago while discussing in bug 730776: - Introduce a new folder in the SDK, here `/test-addons` at SDK root (but we can move it somewhere less visible) - in this folder, we put a set of tests addons with custom package.json, data files, modules, ... - we process each of these addons and just run them, exactly like `cfx run` - the main module of each addon has the responsability to run test, so that they have to include some piece of code to execute test. Similar to what is done for CommonJS module `require('api-utils/test').run(exports);`. But here they have to call this instead: require("test-harness/run-tests").runTestsFromModule(module); (we can tweak that, especially naming) This pull request allows to properly fix bug 730776. Will enable us to write proper tests against simple prefs and help me working on bug 786681 (content-permission attribute in package.json)
Attachment #661629 -
Flags: review?(evold)
Updated•12 years ago
|
Assignee: nobody → poirot.alex
Priority: -- → P2
Updated•12 years ago
|
Attachment #661629 -
Flags: review?(evold) → review+
Assignee | ||
Comment 1•12 years ago
|
||
Irakli, you had some concerns when we discussed about such feature in bug 730776. I hope that this final solution addressed them. As it is a non-naive addition and might have some connection with packageless/new layout work, can you bless this patch (that has already been r+ by Erik).
Comment 2•12 years ago
|
||
(In reply to Alexandre Poirot (:ochameau) from comment #1) > Irakli, you had some concerns when we discussed about such feature in bug > 730776. > I hope that this final solution addressed them. > As it is a non-naive addition and might have some connection with > packageless/new layout work, can you bless this patch (that has already been > r+ by Erik). Looks good to me. I'd just suggest changing location from addon-sdk/test-addons to addon-sdk/test/addons since all the new tests in a future will be moving to addon-sdk/test/ so have test addons there would make more sense.
Comment 3•12 years ago
|
||
Commit pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/57ca4fe43dd7058d6bd275f82e8714f8d132a6d7 Merge pull request #575 from ochameau/tests-addons Bug 791577: Support "test addons". r=@gozala
Assignee | ||
Comment 4•12 years ago
|
||
Oops, put the wrong r= on revision, all credits goes to Erik ;)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.12
You need to log in
before you can comment on or make changes to this bug.
Description
•