Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Fix breakage in update script since the introduction of multiple paths. #54

Merged
merged 1 commit into from Nov 28, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions wptrunner/testloader.py
Expand Up @@ -219,6 +219,8 @@ def __init__(self, test_paths, force_manifest_update=False):
self.test_paths = test_paths
self.force_manifest_update = force_manifest_update
self.logger = structured.get_default_logger()
if self.logger is None:
self.logger = structured.structuredlog.StructuredLogger("ManifestLoader")

def load(self):
rv = {}
Expand Down
27 changes: 16 additions & 11 deletions wptrunner/update.py
Expand Up @@ -318,16 +318,14 @@ def sync_tests(paths, local_tree, wpt, bug):
"metadata_path": paths["sync_dest"]["metadata_path"]}}

manifest_loader = testloader.ManifestLoader(sync_paths)
initial_manifest = manifest_loader.load()
wpt.copy_work_tree(paths["sync_dest"]["test_path"])
new_manifest = metadata.update_manifest(paths["sync"],
paths["sync_dest"]["metadata_path"])
initial_manifests = manifest_loader.load()
wpt.copy_work_tree(paths["sync_dest"]["tests_path"])

local_tree.create_patch("web-platform-tests_update_%s" % wpt.rev,
"Update web-platform-tests to revision %s" % wpt.rev)
local_tree.add_new(os.path.relpath(paths["sync_dest"]["test_path"],
local_tree.add_new(os.path.relpath(paths["sync_dest"]["tests_path"],
local_tree.root))
local_tree.update_patch(include=[paths["sync_dest"]["test_path"],
local_tree.update_patch(include=[paths["sync_dest"]["tests_path"],
paths["sync_dest"]["metadata_path"]])
except Exception as e:
#bug.comment("Update failed with error:\n %s" % traceback.format_exc())
Expand All @@ -336,7 +334,7 @@ def sync_tests(paths, local_tree, wpt, bug):
finally:
pass # wpt.clean()

return initial_manifest, new_manifest
return initial_manifests


def update_metadata(paths, local_tree, initial_rev, bug, log_files, ignore_existing,
Expand Down Expand Up @@ -366,8 +364,11 @@ def update_metadata(paths, local_tree, initial_rev, bug, log_files, ignore_exist
pass

if not local_tree.is_clean():
local_tree.add_new(os.path.relpath(paths["metadata"], local_tree.root))
local_tree.update_patch(include=[paths["metadata"]])
metadata_paths = [manifest_path["metadata_path"]
for manifest_path in paths["test_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)

except Exception as e:
#bug.comment("Update failed with error:\n %s" % traceback.format_exc())
Expand Down Expand Up @@ -424,8 +425,12 @@ def run_update(**kwargs):
wpt_repo = WebPlatformTests(config["web-platform-tests"]["remote_url"],
paths["sync"],
rev=rev)
initial_manifest, new_manifest = sync_tests(paths, local_tree, wpt_repo, bug)
initial_rev = initial_manifest.rev
initial_manifests = sync_tests(paths, local_tree, wpt_repo, bug)
initial_rev = None
for manifest, path_data in initial_manifests.iteritems():
if path_data["url_base"] == "/":
initial_rev = manifest.rev
break

if kwargs["run_log"]:
update_metadata(paths,
Expand Down