Auto-tools/Projects/Marionette update tests: Difference between revisions
m (Fixed some output) |
m (Run specific tests) |
||
| Line 27: | Line 27: | ||
cd mozharness | cd mozharness | ||
python scripts/firefox_ui_updates.py --cfg generic_releng_config.py --cfg update_tests/mozilla-{beta,release}.py | python scripts/firefox_ui_updates.py --cfg generic_releng_config.py --cfg update_tests/mozilla-{beta,release}.py | ||
== Specific tests == | |||
Currently we run two tests for each locale: direct update and fallback update. | |||
You can use --update-direct-only and --update-fallback-only to only run one of the two. | |||
== Chunking == | == Chunking == | ||
Revision as of 19:09, 11 June 2015
Mozmill tests were re-written using Marionette (m21s project). The current code lives in [1] repository. The update tests were also ported and are to be run as part of the automated release process (bug 1148546).
The harness has been developed as a mozharness script firefox_ui_updates.py.
Support
Only Gecko 38 and higher is supported.
Testing matrix
NOTE: We currently test all releases for all locales starting from Gecko 38. This should be reduced in a follow up bug (XXX: To be filed)
There's been some discussions about:
- testing all locales for the last X betas (maybe 3)
- testing all locales for 1 beta for the last Y versions (maybe 3)
- testing all locales for the latest esr
For example:
- If on gecko 40, beta2:
- 39.0b6, 39.0b7, 40.0b1
- 35.0bX, 36.0bY, 37.0bZ (X, Y & Z belonging to the range of 1 to the latest beta version for that gecko version)
- To make things easy we might just test the last beta of the specific gecko version
- 38.0.latest_esr
Run the tests
hg clone http://hg.mozilla.org/build/mozharness cd mozharness python scripts/firefox_ui_updates.py --cfg generic_releng_config.py --cfg update_tests/mozilla-{beta,release}.py
Specific tests
Currently we run two tests for each locale: direct update and fallback update.
You can use --update-direct-only and --update-fallback-only to only run one of the two.
Chunking
In the automation we run the scripts with --this-chunk/--total-chunks to parallelize the execution:
python scripts/firefox_ui_updates.py --cfg generic_releng_config.py --cfg update_tests/mozilla-{beta,release}.py --this-chunk=1 --total-chunks=10
To see what will run on which chunk you can use --dry-run True.
Remember to read about how to run locally in this doc.
Configuration files
There is a config per release branch. You can see them in [2].
The only two values that are specified are:
- the tools update verify config (e.g. mozBeta-firefox-linux64.cfg)
- You can see them all in [3]
- which [4] branch to check out (e.g. mozilla-beta)
Harness options
You can see available options by running this:
python scripts/firefox_ui_updates.py --help
Here's a list of some of the options that are important
--firefox-ui-repo=FIREFOX_UI_REPO
which firefox_ui_tests repo to use
--firefox-ui-branch=FIREFOX_UI_BRANCH
which branch to use for firefox_ui_tests
--tools-repo=TOOLS_REPO
Which tools repo to check out
--tools-tag=TOOLS_TAG
Which revision/tag to use for the tools repository.
--update-verify-config=UPDATE_VERIFY_CONFIG
Which update verify config file to use.
--this-chunk=THIS_CHUNK
What chunk of locales to process.
--total-chunks=TOTAL_CHUNKS
Total chunks to dive the locales into.
--dry-run=DRY_RUN Only show what was going to be tested.
--installer-url=INSTALLER_URL
Point to an installer to download and test against.
--installer-path=INSTALLER_PATH
Point to an installer to test against.
--update-allow-mar-channel=UPDATE_ALLOW_MAR_CHANNEL
Additional MAR channel to be allowed for updates, e.g.
"firefox-mozilla-beta" for updating a release build to
the latest beta build.
--update-channel=UPDATE_CHANNEL
Update channel to use.
--update-direct-only
Only perform a direct update
--update-fallback-only
Only perform a fallback update
--update-target-version=UPDATE_TARGET_VERSION
Version of the updated build.
--update-target-buildid=UPDATE_TARGET_BUILDID
Build ID of the updated build
Internally
The mozharness script takes care of setting up the environment, checking out repositories, updating to the right branches and execute the tests.
Internally, we call the [5] that gets generated from the firefox ui tests repository (the runner is defined in [6]).
The call to the binary looks similar to this: XXX: Double check this
firefox-ui-update --installer /path/to/installer/Firefox%2038.0.dmg --gecko-log=/path/to/cwd/build/gecko.log
The actual tests are defined in [7].
Run on your local machine
If any tests fail in the jobs running for the releases, you will be able to see the exact command to execute on your local machine. It will ask you to use --installer-url and have the right options to use.
Developer mode
To run anything on your local machine you will need to append --cfg developer_config.py. The script will tell you if you don't. It clears any hardcoded paths that are used for Release Engineering machinery.
--installer-url/--installer-path
Instead of using the Release Engineering update verify configuration files, you can also run the harness in these different ways:
--installer-url:
python scripts/firefox_ui_updates.py --firefox-ui-branch mozilla-beta --installer-url http://ftp.mozilla.org/pub/mozilla.org/firefox/candidates/38.0-candidates/build3/mac/en-US/Firefox%2038.0.dmg --cfg developer_config.py
--installer-path
python scripts/firefox_ui_updates.py --firefox-ui-branch mozilla-beta --installer-path `pwd`/Firefox%2038.0.dmg --cfg developer_config.py
Running it more than once
The harness allows you to run specific steps in isolation. You can see the available actions like this:
python scripts/firefox_ui_updates.py --list-actions
Actions available:
* clobber
* checkout
* create-virtualenv
* determine-testing-configuration
* run-tests
If you run once the script, you can run it another time but only execute certain steps or skip certain ones.
For instance, you can say --no-clobber, which will not remove the repositories that the script has checked out.
Extra notes
The update tests allow to specify some more options. Please see all the --update-* options of the "firefox-ui-update --help" command. What you definitely also need is --update-allow-mar-channel, --update-target-version, and --update-target-buildid. The latter two are for final checks that Firefox has been updated to the correct target version. The MAR channel option is for updating a release build to a beta build, which happens for RC builds on the beta channel.
Here are the two examples:
1. Ensure that the update has been applied correctly by checking the target version and build id
./firefox-ui-update --installer %Firefox38.0b8% \ --update-target-version=38.0b9 --update-target-buildid=20150429135941.
Even if the tests pass without those options defined, it does not mean that the update was successful. You really want to check that Firefox got updated to the target build.
2. A beta user got updated to a RC build and has to be brought back to a beta build. Therefore you need --update-allow-mar-channel
Lets say a beta user was on 38.0b9 and got updated to 38.0RC. This RC build is on the release channel, but beta users have to be brought back to beta channel. Given that we currently cannot test updates in multiple steps vXb9 > -> RC -> v(X+1)b1, we have to run vXb9 -> RC, and RC -> v(X+1)b1 separately. Using the RC build as source build only has the release channel active. The option above can also enable the beta channel via update-settings.ini.
./firefox-ui-update --installer %Firefox38.0% --update-target-version=39.0b1 --update-target-buildid=%whateveritwillbe% --update-allow-mar-channel=firefox-mozilla-beta
Archive - Failure modes
The failures reported below are known issues when the infrastructure does not behave as expected. All other harness issues have been dealt with.
firefox-ui-update raises this exception:
self.assertTrue(update_available) AssertionError: False is not true
In the gecko log you will see Error: Unexpected node name, expected: updates, got: parsererror:
*** AUS:SVC Checker:checkForUpdates - sending request to: https://aus4.mozilla.org/update/3/Firefox/38.0/20150330154247/Linux_x86_64-gcc3/hu/beta-localtest/Linux%202.6.32-504.3.3.el6.x86_64%20(GTK%202.20.1)/default/default/update.xml?force=1 *** AUS:SVC Checker:onLoad - request completed downloading document *** AUS:SVC Checker:_updates get - unexpected node name! *** AUS:SVC Checker:onLoad - there was a problem checking for updates. Exception: Error: Unexpected node name, expected: updates, got: parsererror *** AUS:SVC Checker:onLoad - request.status: 503 *** AUS:SVC getStatusTextFromCode - transfer error: A frissítés XML-fájlja nem található. (404), default code: 404 *** AUS:SVC recordInHealthReport - updateCheckFailed - 1503
The "unexpeced node name" comes from here: https://hg.mozilla.org/mozilla-central/annotate/50b95032152c/toolkit/mozapps/update/nsUpdateService.js#l3577
Originally discovered on bug 1152460.
Running out of space
If the machine running the tests runs out of space we can see this issue revealed on the Gecko log:
*** AUS:SVC readStatusFile - status: failed: 7, path: /tmp/tmpAyKRdJ.binary-update-tests/updates/0/update.status
Originall discovered on bug 1154060.
firefox-ui-update will raise an exception:
self.assertTrue(update_available) AssertionError: False is not true
TODO: gather gecko log
The socket for Marionette was left open from a previous run. This is not an infra issue unlike the other ones. This bug needs to be fixed on Marionette bug 1141519 and a work around will be placed through bug 1156475.
Exception raised:
assert(self.wait_for_port()), "Timed out waiting for port!" AssertionError: Timed out waiting for port!
You can see the socket by running this:
$ netstat -anp | grep ':2828 ' | grep TIME_WAIT (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 127.0.0.1:2828 127.0.0.1:47185 TIME_WAIT -
This happens when "the Python client shuts down the socket abruptly (due to a global timeout on the operation, for instance)" bug 1141519
The only way to get back to a good known state is by waiting for that socket to timeout on its own.
If you're running the suite by hand and you have aborted a previous run, you might have left firefox running. If you
MarionetteException: MarionetteException: localhost:2828 is unavailable.
You can see the socket held by firefox you can run this command:
$ netstat -anp | grep ':2828 ' # TODO add output of an instance
You can fix it by running `killall -9 firefox`.