2019-01-29 18:18:42 +03:00
|
|
|
|
Testing
|
|
|
|
|
=======
|
|
|
|
|
|
2019-02-17 18:18:47 +03:00
|
|
|
|
The remote agent has unit- and functional tests located under
|
|
|
|
|
`remote/test/{unit,browser}`.
|
2019-01-29 18:18:42 +03:00
|
|
|
|
|
2019-04-25 13:49:31 +03:00
|
|
|
|
You may run all the tests under a particular subfolder like this:
|
2019-01-29 18:18:42 +03:00
|
|
|
|
|
2019-04-25 13:49:31 +03:00
|
|
|
|
% ./mach test remote
|
2019-02-17 18:18:47 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Unit tests
|
|
|
|
|
----------
|
|
|
|
|
|
|
|
|
|
Because tests are run in parallel and [xpcshell] itself is quite
|
2019-01-29 18:18:42 +03:00
|
|
|
|
chatty, it can sometimes be useful to run the tests in sequence:
|
|
|
|
|
|
2019-04-25 13:47:31 +03:00
|
|
|
|
% ./mach xcpshell-test --sequential remote/test/unit/test_Assert.js
|
2019-01-29 18:18:42 +03:00
|
|
|
|
|
2019-04-25 13:49:31 +03:00
|
|
|
|
The unit tests will appear as part of the `X` (for _xpcshell_) jobs
|
|
|
|
|
on Treeherder.
|
2019-01-29 18:18:42 +03:00
|
|
|
|
|
|
|
|
|
[xpcshell]: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Writing_xpcshell-based_unit_tests
|
2019-02-17 18:18:47 +03:00
|
|
|
|
|
|
|
|
|
|
2019-08-16 15:58:32 +03:00
|
|
|
|
Browser chrome tests
|
|
|
|
|
--------------------
|
2019-02-17 18:18:47 +03:00
|
|
|
|
|
|
|
|
|
We also have a set of functional [browser chrome] tests located
|
|
|
|
|
under _remote/test/browser_:
|
|
|
|
|
|
2019-04-29 16:24:08 +03:00
|
|
|
|
% ./mach mochitest remote/test/browser/browser_cdp.js
|
2019-02-17 18:18:47 +03:00
|
|
|
|
|
2019-04-25 13:49:31 +03:00
|
|
|
|
The functional tests will appear under the `M` (for _mochitest_)
|
2019-10-19 00:01:44 +03:00
|
|
|
|
category in the `remote` jobs on Treeherder.
|
2019-04-25 13:49:31 +03:00
|
|
|
|
|
2019-04-29 16:24:33 +03:00
|
|
|
|
As the functional tests will sporadically pop up new Firefox
|
|
|
|
|
application windows, a helpful tip is to run them in [headless
|
|
|
|
|
mode]:
|
|
|
|
|
|
|
|
|
|
% ./mach mochitest --headless remote/test/browser
|
|
|
|
|
|
|
|
|
|
The `--headless` flag is equivalent to setting the `MOZ_HEADLESS`
|
|
|
|
|
environment variable. You can additionally use `MOZ_HEADLESS_WIDTH`
|
|
|
|
|
and `MOZ_HEADLESS_HEIGHT` to control the dimensions of the virtual
|
|
|
|
|
display.
|
|
|
|
|
|
2019-02-17 18:18:47 +03:00
|
|
|
|
[browser chrome]: https://developer.mozilla.org/en-US/docs/Mozilla/Browser_chrome_tests
|
2019-04-29 16:24:33 +03:00
|
|
|
|
[headless mode]: https://developer.mozilla.org/en-US/Firefox/Headless_mode
|
2019-08-16 15:58:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Puppeteer tests
|
|
|
|
|
---------------
|
|
|
|
|
|
|
|
|
|
In addition to our own Firefox-specific tests, we run the upstream
|
|
|
|
|
[Puppeteer test suite] against our implementation to track progress
|
|
|
|
|
towards achieving full [Puppeteer support] in Firefox.
|
|
|
|
|
|
|
|
|
|
These tests are vendored under _remote/test/puppeteer/_ and are
|
|
|
|
|
run locally like this:
|
|
|
|
|
|
|
|
|
|
% ./mach test remote/test/puppeteer/test
|
|
|
|
|
|
|
|
|
|
On try they appear under the `remote(pup)` symbol, but because they’re
|
|
|
|
|
a Tier-3 class test job they’re not automatically scheduled.
|
|
|
|
|
To schedule the tests, look for `source-test-remote-puppeteer` in
|
|
|
|
|
`./mach try fuzzy`.
|
|
|
|
|
|
|
|
|
|
[Puppeteer test suite]: https://github.com/GoogleChrome/puppeteer/tree/master/test
|
|
|
|
|
[Puppeteer support]: https://bugzilla.mozilla.org/show_bug.cgi?id=puppeteer
|