mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1301473 - Add a wpt-manifest-update command, r=Ms2ger
This updates the manifest without loading any of the test-running infrastructure, or requiring a build. MozReview-Commit-ID: HJko5gUB3ov --HG-- extra : rebase_source : 8ce14b2e76a6f1daf286ff6758c57604c072a6ad
This commit is contained in:
parent
a83ad8b858
commit
f793c63206
@ -40,7 +40,8 @@ FAQ
|
||||
|
||||
It is important to note that in order for the tests to run the
|
||||
manifest file must be updated; this should not be done by hand, but
|
||||
by running `mach web-platform-tests --manifest-update`.
|
||||
by running `mach wpt-manifest-update` (or `mach web-platform-tests
|
||||
--manifest-update`, if you also wish to run some tests).
|
||||
|
||||
`mach web-platform-tests-create <path>` is a helper script designed
|
||||
to help create new web-platform-tests. It opens a locally configured
|
||||
|
@ -236,6 +236,27 @@ testing/web-platform/tests for tests that may be shared
|
||||
proc.wait()
|
||||
|
||||
|
||||
class WPTManifestUpdater(MozbuildObject):
|
||||
def run_update(self):
|
||||
import imp
|
||||
from wptrunner import wptlogging
|
||||
from wptrunner.wptcommandline import get_test_paths, set_from_config
|
||||
from wptrunner.testloader import ManifestLoader
|
||||
|
||||
wpt_dir = os.path.abspath(os.path.join(self.topsrcdir, 'testing', 'web-platform'))
|
||||
|
||||
localpaths = imp.load_source("localpaths",
|
||||
os.path.join(wpt_dir, "tests", "tools", "localpaths.py"))
|
||||
kwargs = {"config": os.path.join(wpt_dir, "wptrunner.ini"),
|
||||
"tests_root": None,
|
||||
"metadata_root": None}
|
||||
|
||||
wptlogging.setup({}, {"mach": sys.stdout})
|
||||
set_from_config(kwargs)
|
||||
test_paths = get_test_paths(kwargs["config"])
|
||||
ManifestLoader(test_paths, force_manifest_update=True).load()
|
||||
|
||||
|
||||
def create_parser_wpt():
|
||||
from wptrunner import wptcommandline
|
||||
return wptcommandline.create_parser(["firefox"])
|
||||
@ -322,3 +343,10 @@ class MachCommands(MachCommandBase):
|
||||
self.setup()
|
||||
wpt_creator = self._spawn(WebPlatformTestsCreator)
|
||||
wpt_creator.run_create(self._mach_context, **params)
|
||||
|
||||
@Command("wpt-manifest-update",
|
||||
category="testing")
|
||||
def wpt_manifest_update(self, **parms):
|
||||
self.setup()
|
||||
wpt_manifest_updater = self._spawn(WPTManifestUpdater)
|
||||
wpt_manifest_updater.run_update()
|
||||
|
Loading…
Reference in New Issue
Block a user