QA/Automation/Projects/Mozmill Automation/Environment/Design Documents

From MozillaWiki
Jump to: navigation, search

The general design of the Mozmill environment will be similar to the cfx environment implementation of the Add-ons SDK (Jetpack). All required scripts and tool packages will be made available under the respective sub folders. Switching into the environment will make all the pre-packaged tools available.

The following structure will exist:

 |
 |-bin
 | |-activate
 | |-deactivate
 | |-mozmill
 | |-...
 |-python-lib
   |-jsbridge
   |-mercurial
   |-mozmill
   |-mozrunner

In general all those changes would have to be done for all the scripts under bin/:

 #!/usr/bin/env python
 import sys, os
 
 cur_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 sys.path.insert(0, os.path.join(cur_dir, 'lib', 'python'))
 from mozmill import cli
 sys.exit(cli())

For updating the already installed versions the following command has to be run:

 pip install --upgrade mozmill --install-option="--install-lib=/home/test-env/lib/python"

Finally we should not forget to remove all the already compiled .pyc files before the upload of the environment:

 $ find . -name '*.pyc' -exec rm {} \;

On Windows we can also can get rid of distributing the whole Python environment by using the py2exe tool (http://www.py2exe.org/). We could strip down the size on Windows by more than 50%.