Add ability to add shared test module paths when RELATIVE_ROOT relative paths are not an option



9 years ago
2 years ago


(Reporter: asuth, Assigned: asuth)





9 years ago
Currently shared test libraries must exist in the same directory subtree as the tests, at least if you don't want to do something horrible with nsIEnvironment and RELATIVE_ROOT.  This is limiting.

Thunderbird wants to be able allow its mozmill test driver and shared utility modules to be used for testing extensions that do not live in-tree (and are not installed into the tree as part of the process).

The collector mechanism is more than capable of explicitly scanning certain directories, so this is mainly a question of adding the appropriate command line arg to mozmill and relaying it across the jsbridge.  (I am going to do this.)
In combination with bug 515341 that would be perfect.
Blocks: 515341

Comment 2

9 years ago
I've pushed such a thing to my github repo:

Sadly there is some whitespace noise in there.

Comment 3

8 years ago
Hey Andrew,

I've looked over this patch and tested it, and I think I'd like to take it for Mozmill 1.4.2.  Can you give me a version without the whitespace changes?
I get this traceback when running without specifying the argument:

Traceback (most recent call last):
  File "/usr/local/bin/mozmill", line 8, in <module>
    load_entry_point('mozmill==1.4.2b1', 'console_scripts', 'mozmill')()
  File "/Users/harth/mozmill/mozmill/mozmill/", line 731, in cli
  File "/Users/harth/mozmill/mozmill/mozmill/", line 688, in run
  File "/Users/harth/mozmill/mozmill/mozmill/", line 272, in run_tests
    frame.runTestFile(test, False, self.libdirs)
AttributeError: 'MozMill' object has no attribute 'libdirs'

my command line is:
mozmill -t ~/mozmill-tests/firefox/testAddons/testSearchAddons.js
Andrew, so this bug is about passing a command line option which specifies an external library folder to the tests?

Comment 6

8 years ago
The underlying goal is for a developer to be able to write a Thunderbird extension and test it using Thunderbird's mozmill test driver and having access to Thunderbird's shared mozmill-based modules.  (Namely those found in comm-central/mail/test/mozmill/shared-modules.)

I was accomplishing that in this case by allowing the test directory to be set to a path in the user's extension while it pulled the shared modules out of the thunderbird subtree.  The solution could work another way, and maybe you already have this in hand, in which case feel free to close this.
Thanks Andrew. While reading you last comment I think this bug is similar to bug 581004. And exactly this missing feature has been fixed with CommonJS.
Marking as given by the last comments.
Last Resolved: 8 years ago
Resolution: --- → FIXED
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.