summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/harness/wptrunner/update/metadata.py
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/harness/wptrunner/update/metadata.py
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/harness/wptrunner/update/metadata.py')
-rw-r--r--testing/web-platform/harness/wptrunner/update/metadata.py75
1 files changed, 75 insertions, 0 deletions
diff --git a/testing/web-platform/harness/wptrunner/update/metadata.py b/testing/web-platform/harness/wptrunner/update/metadata.py
new file mode 100644
index 000000000..c62dfec46
--- /dev/null
+++ b/testing/web-platform/harness/wptrunner/update/metadata.py
@@ -0,0 +1,75 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import os
+
+from .. import metadata, products
+
+from base import Step, StepRunner
+
+class GetUpdatePropertyList(Step):
+ provides = ["property_order", "boolean_properties"]
+
+
+ def create(self, state):
+ property_order, boolean_properties = products.load_product_update(
+ state.config, state.product)
+ state.property_order = property_order
+ state.boolean_properties = boolean_properties
+
+
+class UpdateExpected(Step):
+ """Do the metadata update on the local checkout"""
+
+ provides = ["needs_human"]
+
+ def create(self, state):
+ if state.sync_tree is not None:
+ sync_root = state.sync_tree.root
+ else:
+ sync_root = None
+
+ state.needs_human = metadata.update_expected(state.paths,
+ state.serve_root,
+ state.run_log,
+ rev_old=None,
+ ignore_existing=state.ignore_existing,
+ sync_root=sync_root,
+ property_order=state.property_order,
+ boolean_properties=state.boolean_properties)
+
+
+class CreateMetadataPatch(Step):
+ """Create a patch/commit for the metadata checkout"""
+
+ def create(self, state):
+ if state.no_patch:
+ return
+
+ local_tree = state.local_tree
+ sync_tree = state.sync_tree
+
+ if sync_tree is not None:
+ name = "web-platform-tests_update_%s_metadata" % sync_tree.rev
+ message = "Update %s expected data to revision %s" % (state.suite_name, sync_tree.rev)
+ else:
+ name = "web-platform-tests_update_metadata"
+ message = "Update %s expected data" % state.suite_name
+
+ local_tree.create_patch(name, message)
+
+ if not local_tree.is_clean:
+ metadata_paths = [manifest_path["metadata_path"]
+ for manifest_path in state.paths.itervalues()]
+ for path in metadata_paths:
+ local_tree.add_new(os.path.relpath(path, local_tree.root))
+ local_tree.update_patch(include=metadata_paths)
+ local_tree.commit_patch()
+
+
+class MetadataUpdateRunner(StepRunner):
+ """(Sub)Runner for updating metadata"""
+ steps = [GetUpdatePropertyList,
+ UpdateExpected,
+ CreateMetadataPatch]