def create(self, state): import manifest test_manifest = state.test_manifest state.initial_rev = test_manifest.rev manifest.update(state.sync["path"], "/", test_manifest) manifest.write(test_manifest, os.path.join(state.metadata_path, "MANIFEST.json"))
def main(request, response): path = os.path.join(root, "MANIFEST.json") manifest_file = manifest.load(path) manifest.update(root, "/", manifest_file) manifest.write(manifest_file, path) return [("Content-Type", "application/json")], json.dumps({"url": "/MANIFEST.json"})
def sync_tests(paths, local_tree, wpt, bug): wpt.update() do_delayed_imports(paths["sync"]) try: # bug.comment("Updating to %s" % wpt.rev) sync_paths = {"/": {"tests_path": paths["sync"], "metadata_path": paths["sync_dest"]["metadata_path"]}} manifest_loader = testloader.ManifestLoader(sync_paths) test_manifest = manifest_loader.load_manifest(**sync_paths["/"]) initial_rev = test_manifest.rev manifest.update(sync_paths["/"]["tests_path"], "/", test_manifest) manifest.write(test_manifest, os.path.join(sync_paths["/"]["metadata_path"], "MANIFEST.json")) 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"]["tests_path"], local_tree.root)) 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()) sys.stderr.write(traceback.format_exc()) raise finally: pass # wpt.clean() return initial_rev
def main(request, response): path = os.path.join(root, "MANIFEST.json") manifest_file = manifest.load(path) manifest.update(root, "/", manifest_file) manifest.write(manifest_file, path) return [("Content-Type", "application/json") ], json.dumps({"url": "/MANIFEST.json"})
def load_manifest(test_root): if manifest is None: do_test_relative_imports(test_root) mainfest_path = os.path.abspath(os.path.join(os.path.split(__file__)[0], "metadata", "MANIFEST.json")) manifest.setup_git(test_root) test_manifest = manifest.load(mainfest_path) manifest.update(test_manifest) return test_manifest
def update(tests_root, manifest, working_copy=False): tree = None if not working_copy: tree = vcs.Git.for_path(tests_root, manifest.url_base) if tree is None: tree = vcs.FileSystem(tests_root, manifest.url_base) return manifest.update(tree)
def update(tests_root, url_base, manifest, ignore_local=False): if vcs.is_git_repo(tests_root): tests_tree = GitTree(tests_root, url_base) remove_missing_local = False else: tests_tree = NoVCSTree(tests_root, url_base) remove_missing_local = not ignore_local if not ignore_local: local_changes = tests_tree.local_changes() else: local_changes = None manifest.update(tests_root, url_base, tests_tree.current_rev(), tests_tree.committed_changes(manifest.rev), local_changes, remove_missing_local=remove_missing_local)
def update_manifest(self, manifest_path, tests_path, url_base="/", recreate=False): self.logger.info("Updating test manifest %s" % manifest_path) json_data = None if not recreate: try: with open(manifest_path) as f: json_data = json.load(f) except IOError: #If the existing file doesn't exist just create one from scratch pass if not json_data: manifest_file = manifest.Manifest(None, url_base) else: manifest_file = manifest.Manifest.from_json(json_data) manifest.update(tests_path, url_base, manifest_file) manifest.write(manifest_file, manifest_path)
def update(tests_root, manifest, manifest_path=None, working_copy=True, cache_root=None, rebuild=False): logger.warning("Deprecated; use manifest.load_and_update instead") logger.info("Updating manifest") tree = vcs.get_tree(tests_root, manifest, manifest_path, cache_root, working_copy, rebuild) return manifest.update(tree)
def update(tests_root, manifest, manifest_path=None, working_copy=False, cache_root=None, rebuild=False): logger.warning("Deprecated; use manifest.load_and_update instead") logger.info("Updating manifest") tree = vcs.get_tree(tests_root, manifest, manifest_path, cache_root, working_copy, rebuild) return manifest.update(tree)
def merge_manifests(age_manifests, client_manifests, secure_manifests): logging.info("Merging manifests...") for manifest_names in gather_manifests.values(): manifest = client_manifests.get(manifest_names.full) if manifest: manifest.update( itertools.chain.from_iterable(age_manifests.values())) manifest.update( itertools.chain.from_iterable(secure_manifests.values())) manifest = client_manifests.get(manifest_names.thin) if manifest: manifest.update( itertools.chain.from_iterable(secure_manifests.values())) manifests = {} manifests.update(age_manifests) manifests.update(client_manifests) manifests.update(secure_manifests) return manifests
def create_manifest(self): logger.info("Creating test manifest") manifest.setup_git(self.tests_root) manifest_file = manifest.Manifest(None) manifest.update(manifest_file) manifest.write(manifest_file, self.manifest_path)
def create_manifest(self, manifest_path, tests_path, url_base="/"): self.logger.info("Creating test manifest %s" % manifest_path) manifest_file = manifest.Manifest(None, url_base) manifest.update(tests_path, url_base, manifest_file) manifest.write(manifest_file, manifest_path)