Confirmed users
3,376
edits
| Line 119: | Line 119: | ||
== Mozilla Unittests == | == Mozilla Unittests == | ||
We have successfully run all our automation tests on a remote device. Here are links to the code and so notes about how these are run for anybody extending or debugging. | |||
First off, we did a lot of work to refactor all the existing python harnesses (talos, mochitest, reftest, xpcshell) into classes and smaller methods. This was necessary in order to subclass these scripts so we can overload certain methods and add or remove specific functionality. | |||
In addition to the refactoring, we had to change a lot of the tests to remove the hardcoded localhost and 127.0.0.1 references. This was a large change, but it gave us the option to run all mochitest (plain not chrome), talos, and reftest tests from a remote webserver. This is the recommended way to run all the tests to avoid setting up a webserver on the device. | |||
As a developer working on testing your code or fixing a remote test, please take note that there could be a small issue with a test running remotely vs a real failure on the product. | |||
Mochitest ([[http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/runtestsremote.py runtestsremote.py]]): | |||
* this is a subclass of automation.py and runtests.py. | |||
* Overloads the Process class defined in automation.py to use devicemanager.py | |||
* adds extra command line arguments | |||
** --deviceIP, --devicePort, --remote-logfile, --remote-webserver, --http-port, --ssl-port, --remoteProductName | |||
** --remote-logfile requires knowledge of the remote system and the full path to the log file, not /tests. This is embedded in the url and we are not going to be munging that | |||
* assumes fennec is installed in /tests/fennec | |||
* assumes profile in /tests/mochitest | |||
Reftest([[http://mxr.mozilla.org/mozilla-central/source/layout/tools/reftest/remotereftest.py remotereftest.py]]): | |||
* subclass of automation.py and reftest.py | |||
* Overloads the Process class defined in automation.py to use devicemanager.py | |||
* adds extra command line arguments | |||
** --device, --devicePort, --remoteProductName, --remoteAppName, --remote-webserver | |||
* assumes fennec is installed in /tests/fennes | |||
* assumes reftest.jar is included in the fennec build, not copied to it as we do on desktop | |||
* assumes profile in /tests/reftest | |||
* currently doesn't work with http(...) reftests | |||
Xpcshell([[http://mxr.mozilla.org/mozilla-central/source/testing/xpcshell/remotexpcshelltests.py remotexpcshelltests.py]]): | |||
* subclass of runxpcshelltests.py | |||
* adds extra command line arguments | |||
** --device | |||
* assumes fennec is installed in /tests/fennes | |||
* assumes profile in /tests/xpcshell | |||
* will create a .zip of the xpcshell/* tests and copy that to device under /tests/xpcshell | |||
== DeviceManager Examples == | == DeviceManager Examples == | ||