WebExtensions/Try Server: Difference between revisions

Jump to navigation Jump to search
Show more efficient try syntax in examples
(Remove stray ).)
(Show more efficient try syntax in examples)
Line 18: Line 18:
* X (xpcshell tests)
* X (xpcshell tests)
** xpcshell
** xpcshell
* TV ([https://developer.mozilla.org/en-US/docs/Mozilla/QA/Test_Verification test verification mode]; same effect as "mach test path/to/your/test --verify" locally)
* TV ([https://developer.mozilla.org/en-US/docs/Mozilla/QA/Test_Verification test verification mode]; same effect as "mach test path/to/your/test --verify" locally) (desktop platforms only; not available on Android)
** test-verify-e10s
** test-verify-e10s
* ES ([https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/ESLint ESlint])
* ES ([https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/ESLint ESlint])
Line 35: Line 35:


* Run all relevant tests. This is expensive and should only be used when you don't know which tests should be run, because it also includes many non-extension tests.
* Run all relevant tests. This is expensive and should only be used when you don't know which tests should be run, because it also includes many non-extension tests.
   <nowiki>mach try -b do -p win64,linux64,macosx64,android-api-64 -u mochitests,xpcshell,test-verify-e10s --artifact</nowiki>
   <nowiki>mach try -b do -p win64,linux64,macosx64,android-api-16 -u mochitests,xpcshell,test-verify-e10s --artifact</nowiki>
* Run all relevant tests, without non-extension tests. This is cheaper than the previous command, but results in many red test "failures" because some jobs will start but not identify tests due to the tag filter. To interpret the results, ignore red failures and only look at the oranges.
* Run all relevant tests, without non-extension tests. The command with the `--tag=webextensions` flag uses your local checkout and .mozconfig configuration to identify the tests. Some Android-only tests may not run if your current configuration targets desktop.
   <nowiki>mach try -b do -p win64,linux64,macosx64,android-api-64 -u mochitests,xpcshell,test-verify-e10s --artifact --tag=webextensions</nowiki>
   <nowiki>mach try -b do -p win64,linux64,macosx64,android-api-16 -u test-verify-e10s --artifact --tag=webextensions</nowiki>
* Run browser-chrome extension tests (and many other browser-chrome tests, but at least less expensive than just "mochitests"). This test type is only used on desktop, so Android was omitted from the platform flag ("-p").
* Run browser-chrome extension tests (and many other browser-chrome tests, but at least less expensive than just "mochitests"). This test type is only used on desktop, so Android was omitted from the platform flag ("-p").
   <nowiki>mach try -b do -p win64,linux64,macosx64 -u mochitest-bc,test-verify-e10s --artifact</nowiki>
   <nowiki>mach try -b do -p win64,linux64,macosx64 -u mochitest-bc,test-verify-e10s --artifact</nowiki>
* Run extension tests only, without even scheduling non-extension tests. This command accounts uses your local checkout and .mozconfig configuration to identify the tests.
  <nowiki>mach try -b do -p win64,linux64,macosx64 -u mochitests,mochitest-bc,xpcshell --artifact --and --tag=webextensions</nowiki>
* Run extension tests on Android (requires a [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build#Prepare_a_Firefox_for_Android_mozconfig_file mozconfig file for Android]; otherwise tests in mobile/android/components/extensions/test/ will not be run. The MOZCONFIG environment variable is used to select a different mozconfig file, so that you can develop for multiple platforms with a single checkout):
* Run extension tests on Android (requires a [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build#Prepare_a_Firefox_for_Android_mozconfig_file mozconfig file for Android]; otherwise tests in mobile/android/components/extensions/test/ will not be run. The MOZCONFIG environment variable is used to select a different mozconfig file, so that you can develop for multiple platforms with a single checkout):
   <nowiki>MOZCONFIG=/path/to/mozconfig-for-android mach try -b do -p android-api-16 -u mochitest-o,xpcshell --artifact --and --tag=webextensions</nowiki>
   <nowiki>MOZCONFIG=/path/to/mozconfig-for-android mach try -b do -p android-api-16 --artifact --tag=webextensions</nowiki>


It may take several seconds before a "mach try" command with the "--and" and "--tag=webextensions" flag completes. If you already know the directory that contains the test, it is recommended to use the directory instead of "--tag=webextensions", e.g.:
It may take several seconds before a "mach try" command with the "--tag=webextensions" flag completes. If you already know the directory that contains the test, it is recommended to use the directory instead of "--tag=webextensions", e.g.:


* Run tests in specific directories for desktop:
* Run tests in specific directories for desktop:
Line 52: Line 50:
   <nowiki>MOZCONFIG=/path/to/mozconfig-for-android mach try -b do -p android-api-16 -u mochitests,mochitest-o,xpcshell --artifact --and toolkit/components/extensions/test/ mobile/android/components/extensions/test/</nowiki>
   <nowiki>MOZCONFIG=/path/to/mozconfig-for-android mach try -b do -p android-api-16 -u mochitests,mochitest-o,xpcshell --artifact --and toolkit/components/extensions/test/ mobile/android/components/extensions/test/</nowiki>


By default, a test that match any specified test tags ("--tag") or suite ("-u") will be scheduled. To only run tests that match all specified rules, include "--and" in the try syntax.
When the "--and" flag is used, the set of tests is computed locally. To see what tests are going to be scheduled, add "--no-push".
When the "--and" flag is used, the set of tests is computed locally. To see what tests are going to be scheduled, add "--no-push".


47

edits

Navigation menu