Bug 1425317 - Hook geckodriver up to mach's test command. r=ahal

This removes the subcommands for "./mach geckodriver", reverting
it back to have the meaning of running the geckodriver binary.

The build- and test commands are now integrated with mach, which
means you can run "./mach build testing/geckodriver" and "./mach
test testing/geckodriver" to run tests.  This is backed by a new
top-level "./mach geckodriver-test" command, which we will not be
announcing.

MozReview-Commit-ID: CiQsfNqrvIp

--HG--
extra : rebase_source : 6c492b7e1128e4858e42ae4bb35ab4b29564dbeb
This commit is contained in:
Andreas Tolfsen 2017-12-15 17:27:52 -06:00
parent 392a4bf408
commit b5acf25317
4 changed files with 23 additions and 39 deletions

View File

@ -124,12 +124,11 @@ you put this in your [mozconfig]:
When you have, you are ready to start off your first build:
% ./mach geckodriver build
% ./mach build testing/geckodriver
The geckodriver executable will appear in `${objdir}/dist/bin/geckodriver`
alongside firefox-bin. To run it you can use mach:
To run the executable from the objdir:
% ./mach geckodriver run -- --version
% ./mach geckodriver -- --version
0:00.27 /home/ato/src/gecko/obj-x86_64-pc-linux-gnu/dist/bin/geckodriver --version --binary /home/ato/src/gecko/obj-x86_64-pc-linux-gnu/dist/bin/firefox
geckodriver 0.19.0 (f3e939a81ee1169f9501ad96eb43bbf4bf4a1bde 2017-10-11)
@ -155,9 +154,9 @@ compatibility between _different_ WebDriver implementations for
different browsers.
In addition to the WPT tests, geckodriver and webdriver have unit tests.
You can also use the mach geckodriver command to run geckodriver tests:
You can use a mach command to run them:
% ./mach geckodriver test
% ./mach test testing/geckodriver
The webdriver crate tests are unfortunately not yet runnable through mach.
Work to make this possible is tracked in [[https://bugzil.la/1424369]].

View File

@ -575,14 +575,9 @@ ensure you put this in your [mozconfig]:
ac_add_options --enable-geckodriver
The _geckodriver_ binary will appear in `${objdir}/dist/bin/geckodriver`
alongside _firefox-bin_.
The following self-explanatory targets are available through mach:
* `./mach geckodriver build`
* `./mach geckodriver test`
* `./mach geckodriver run`
You build geckodriver with the `./mach build testing/geckodriver`
command, run tests with `./mach test testing/geckodriver`, and run
the built executable with `./mach geckodriver -- --other --flags`.
[Rust]: https://www.rust-lang.org/
[Mozilla]: https://www.mozilla.org/en-US/

View File

@ -22,17 +22,11 @@ from mozbuild.base import (
@CommandProvider
class GeckoDriver(MachCommandBase):
class GeckoDriover(MachCommandBase):
@Command("geckodriver",
category="post-build",
description="WebDriver implementation for Gecko",
conditions=[conditions.is_firefox])
def geckodriver(self):
pass
@SubCommand("geckodriver", "run",
description="Run geckodriver.")
description="Run the WebDriver implementation for Gecko.")
@CommandArgument("--binary", type=str,
help="Firefox binary (defaults to the local build).")
@CommandArgument("params", nargs="...",
@ -98,26 +92,16 @@ class GeckoDriver(MachCommandBase):
return self.run_process(args=args, ensure_exit_code=False,
pass_thru=True)
@SubCommand("geckodriver", "build",
description="Build geckodriver.")
@CommandArgument("-v", "--verbose", action="store_true",
help="Verbose output for what commands the build is running.")
def build(self, verbose=False):
from mozbuild.controller.building import BuildDriver
self.log_manager.enable_all_structured_loggers()
@CommandProvider
class GeckoDriverTest(MachCommandBase):
driver = self._spawn(BuildDriver)
return driver.build(
what=["testing/geckodriver"],
verbose=verbose,
mach_context=self._mach_context)
@SubCommand("geckodriver", "test",
@Command("geckodriver-test",
category="post-build",
description="Run geckodriver unit tests.")
@CommandArgument("-v", "--verbose", action="store_true",
help="Verbose output for what commands the build is running.")
def test(self, verbose=False):
def test(self, verbose=False, **kwargs):
from mozbuild.controller.building import BuildDriver
self.log_manager.enable_all_structured_loggers()

View File

@ -48,6 +48,12 @@ TEST_SUITES = {
'mach_command': 'check-spidermonkey',
'kwargs': {'valgrind': False},
},
# TODO(ato): integrate geckodriver tests with moz.build
'geckodriver': {
'mach_command': 'geckodriver-test',
'aliases': ('testing/geckodriver',),
'kwargs': {},
},
'mochitest-a11y': {
'mach_command': 'mochitest',
'kwargs': {'flavor': 'a11y', 'test_paths': None},
@ -133,12 +139,12 @@ TEST_FLAVORS = {
},
'reftest': {
'mach_command': 'reftest',
'kwargs': {'tests': []}
'kwargs': {'tests': []},
},
'steeplechase': {},
'web-platform-tests': {
'mach_command': 'web-platform-tests',
'kwargs': {'include': []}
'kwargs': {'include': []},
},
'xpcshell': {
'mach_command': 'xpcshell-test',