Closed Bug 581004 Opened 15 years ago Closed 15 years ago

Shared test module chain-loading not possible

Categories

(Testing Graveyard :: Mozmill, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mozdev, Unassigned)

References

Details

(Whiteboard: [mozmill-1.4.2-][mozmill-1.5.1])

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.2.7) Gecko/20100713 Firefox/3.6.7 Build Identifier: An extension Mozmill tests shared-modules cannot load the Mozmill shared-modules such as the UtilsAPI module etc. Reproducible: Always
Attached patch Patch demonstrating the problem (obsolete) — Splinter Review
The provided example patch produces the following error: ERROR - Test Failure: {u'exception': {u'message': u'this._UtilsAPI is undefined', u'lineNumber': 21, u'stack': u'assertElementVisible([object Object],[object Object],true)@file:///tmp/tmpvgjg-S.mozrunner/extensions/mozmill@mozilla.com/resource/modules/frame.js -> file:///home/firefox/mozmill-tests/addons/example@example.com/shared-modules/testSharedAPI.js:21\n()@file:///tmp/tmpvgjg-S.mozrunner/extensions/mozmill@mozilla.com/resource/modules/frame.js -> file:///home/firefox/mozmill-tests/addons/example@example.com/tests/testModules.js:19\n((function () {controller.sleep(1000);var res;var menu_item = new (elementslib.ID)(controller.window.document, "file-menu");controller.click(menu_item);res = controller.assertProperty(menu_item, "id", "file-menu");shared_api.assertElementVisible(controller, menu_item, true);}))@file:///tmp/tmpvgjg-S.mozrunner/extensions/mozmill@mozilla.com/resource/modules/frame.js:468\n([object Object])@file:///tmp/tmpvgjg-S.mozrunner/extensions/mozmill@mozilla.com/resource/modules/frame.js:520\n([object Object])@file:///tmp/tmpvgjg-S.mozrunner/extensions/mozmill@mozilla.com/resource/modules/frame.js:562\n("/home/firefox/mozmill-tests/addons/example@example.com")@file:///tmp/tmpvgjg-S.mozrunner/extensions/mozmill@mozilla.com/resource/modules/frame.js:411\n("/home/firefox/mozmill-tests/addons/example@example.com")@file:///tmp/tmpvgjg-S.mozrunner/extensions/mozmill@mozilla.com/resource/modules/frame.js:568\n((function (dir, invokedFromIDE) {var runner = new Runner(new Collector, invokedFromIDE);runner.runTestDirectory(dir);runner.end();return true;}),[object Array])@file:///tmp/tmpvgjg-S.mozrunner/extensions/jsbridge@mozilla.com/resource/modules/server.js:164\n("c3610daa-9593-11df-89c5-001fe218e5cd",(function (dir, invokedFromIDE) {var runner = new Runner(new Collector, invokedFromIDE);runner.runTestDirectory(dir);runner.end();return true;}),[object Array])@file:///tmp/tmpvgjg-S.mozrunner/extensions/jsbridge@mozilla.com/resource/modules/server.js:168\n@file:///tmp/tmpvgjg-S.mozrunner/extensions/jsbridge@mozilla.com/resource/modules/server.js:244\n', u'fileName': u'file:///tmp/tmpvgjg-S.mozrunner/extensions/mozmill@mozilla.com/resource/modules/frame.js -> file:///home/firefox/mozmill-tests/addons/example@example.com/shared-modules/testSharedAPI.js'}} Test Failed : testProperty in /home/firefox/mozmill-tests/addons/example@example.com/tests/testModules.js Passed 1 :: Failed 1 :: Skipped 0
Please note that I have both used the approach "collector.getModule('UtilsAPI')" and the approach "UtilsAPI.UtilsAPI" to no avail.
Attached patch More simplifiedSplinter Review
Thanks for the test. I have even simplified it a bit more. A quick check shows me that we parse SharedAPI and also find the reference to the global shared modules folder and the UtilsAPI but we do not load those modules referenced to other folders.
Attachment #459415 - Attachment is obsolete: true
(In reply to comment #3) > A quick check shows me that we parse SharedAPI and also find the reference to > the global shared modules folder and the UtilsAPI but we do not load those > modules referenced to other folders. Clint, this will prevent add-on authors to correctly write tests for Mozmill without having to duplicate all of our shared module code. Can we try to fold it into 1.4.2 if we have a bit of free resources? A fix will help a lot.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [mozmill-1.4.2?]
Would the change proposed in bug 555410 work for you? That's a pretty small change that I'm comfortable taking for 1.4.2, and I think that should give you the flexibility you're looking for, as I understand things.
Summary: Module loading in chain not possible → Shared test module chain-loading not possible
I think the change proposed in bug 555410 would both fulfill my need and obsoletes this present bug. I was trying this shared test module chain-loading only because it seemed the only way out to not duplicate Mozmill-test code. As I understand well, bug 555410 puts the lib-management-job on the person in charge of setting up the test environment, while bug 515341 puts the lib-management-job on the developer. As Henrik said, having both would be perfect. But if I had to choose only one, I would vote for the bug 555410 solution which seems more robust and easy to use in different environments where the relative locations of the different components may vary.
(In reply to comment #6) > I think the change proposed in bug 555410 would both fulfill my need and > obsoletes this present bug. I was trying this shared test module chain-loading > only because it seemed the only way out to not duplicate Mozmill-test code. > > As I understand well, bug 555410 puts the lib-management-job on the person in > charge of setting up the test environment, while bug 515341 puts the > lib-management-job on the developer. As Henrik said, having both would be > perfect. But if I had to choose only one, I would vote for the bug 555410 > solution which seems more robust and easy to use in different environments > where the relative locations of the different components may vary. As we're going to drastically change how all this works in the next version of mozmill to make it easier and more robust, I only want to take the smallest change I can do right now to solve the problem. If 555410 will get us there for now, then let's do that. Thanks for the quick response.
Whiteboard: [mozmill-1.4.2?] → [mozmill-1.4.2-]
Depends on: 588682
Shall we mark this bug as wontfix now?
Whiteboard: [mozmill-1.4.2-] → [mozmill-1.4.2-][wontfix?]
(In reply to comment #8) > Shall we mark this bug as wontfix now? Please, where can I get the Mozmill version/module to test that it fulfills the need expressed in this ticket?
This is now fixed with CommonJS. You simply have to update your tests to be able to use our global shared modules.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [mozmill-1.4.2-][wontfix?] → [mozmill-1.4.2-][mozmill-1.5.1]
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: