Auto-tools/Projects/CrossWeave/Running CrossWeave

Installing CrossWeave

CrossWeave has the following prerequisites:

  • python 2.5 or greater
  • mozrunner from jonallengriffin's github fork

To install mozrunner:

  1. git clone git://github.com/jonallengriffin/mozrunner.git
  2. cd mozrunner
  3. python setup.py install

To install CrossWeave:

  1. hg clone http://hg.mozilla.org/automation/crossweave/

The Weave Extension

In order to operate, Crossseave installs the Weave extension into the profiles that it uses. Crossweave can use a specific version of the extension, if the --xpi-path argument is used; otherwise it will get the latest version of Sync code from the fx-sync repo, and build the extension itself.

The CrossWeave Config File: config.json

Before running CrossWeave, you should edit the file config.txt and specify the Weave account you wish to use. You have two choices:

  1. Supply the username, password, and passphrase for an account that already exists on the production Weave server. This account will be wiped during testing, so only use an account that's specifically created for testing!
  2. Supply the admin-secret value, and modify the serverURL value if needed, to allow CrossWeave to create its own accounts dynamically on a staging server.

For option 1, the config.txt file might look like:

account:
  serverURL: https://stage-auth.services.mozilla.com/
  admin-secret: ""
  username: crossweave1
  password: crossweave1crossweave1
  passphrase: crossweave1secret
resultstore:
  host: brasstacks.mozilla.com
  path: /resultserv/post/

Starting CrossWeave

You can view CrossWeave's command-line arguments using:

 python crossweave.py --help

Options:
  -h, --help            show this help message and exit
  --post-results        post the test results to the url defined in the config
                        file
  --continuous          when --xpi-path is not specified, keep runningtests
                        each time a new commit is detected
  --test-file=TESTFILE  path to the test file to run [default: sync.test]
  --log-file=LOGFILE    path to the log file [default: crossweave.log]
  --binary=BINARY       path to the Firefox binary; if omitted, the PATH will
                        be searched
  --xpi-path=XPIPATH    directory containing the Weave XPI [default: none]
  --config-file=CONFIGFILE
                        path to the config file to use [default: config.txt]
  --manifest=MANIFEST   path to the test manifest file which lists tests to be
                        run [default: none]

With no arguments, CrossWeave will sync the latest Sync code from http://hg.mozilla.org/services/fx-sync, will run the test 'sync.test' using the system's default Firefox version, and write a log to crossweave.log in the CrossWeave folder.

While a test is running, CrossWeave will open and close Firefox once for each phase. You can work in other open Firefox windows while this is occurring, but don't work in the window opened by CrossWeave.

After running a test, if everything went well, you should see on the console something like:

Crossweave test results:
       phase1: PASS
       phase2: PASS
       phase3: PASS
       phase4: PASS

If an error occurs during a phase, the test will be terminated; subsequent phases will not be run. You can consult the log file for additional information.

To run the tests in the same way that they are run on the Crossweave test machine, use this command-line:

python crossweave.py --continuous --manifest=manifest.txt --binary=/path/to/firefox4.0