Changes

Jump to: navigation, search

WebExtensions/Contribution Onramp

756 bytes added, 14:42, 31 July 2020
--log-mach-verbose is not really documented anywhere (https://bugzilla.mozilla.org/show_bug.cgi?id=1656513 ). Add it here, along with other tips for testing.
** mobile/android/components/extensions/test/mochitest ([https://searchfox.org/mozilla-central/source/mobile/android/components/extensions/test/mochitest Searchfox link])
=== Running tests ===These tests can be run with the “mach test” <code>mach test</code> command. To run a specific test(s), use “mach pass the name of the test [paths file or directory to <code>mach test files or directories]”</code>.Sometimes "<code>mach test" </code> has bugs (e.g. [https://bugzilla.mozilla.org/show_bug.cgi?id=1498636 bug 1498636] and [https://bugzilla.mozilla.org/show_bug.cgi?id=1495311 bug 1495311]); in that case use "<code>mach xpcshell-test" </code> or "<code>mach mochitest" </code> instead of "<code>mach test" </code> to run the test.
<code>mach test</code> has minimal output by default. To debug test failures, increase the verbosity of the logs with the <code>--verbose --log-mach-verbose</code> flags. The <code>--sequential</code> flag is not required, but allows for easier debugging because only one test is run at a time (instead of multiple in parallel). Al together, the command to run tests and get maximum debug output is:
<code>mach test --verbose --log-mach-verbose --sequential [paths to test files]</code>
 
=== Adding new tests ===
Add your test to an existing file when it is small and fits in that test. Otherwise, create a new test file, and register the test file in one of the .ini files in the same directory as your test, usually browser-common.ini or xpcshell-common.ini.
After creating a new test file, run <code>mach build</code> before running tests. It is not necessary to rebuild if you are changing an existing test file.
A test consists of multiple subtasks, which are defined in the test files via add_task(...).
44
edits

Navigation menu