예제 #1
0
 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"))
예제 #2
0
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"})
예제 #3
0
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
예제 #4
0
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"})
예제 #5
0
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
예제 #6
0
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)
예제 #7
0
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)
예제 #8
0
파일: update.py 프로젝트: xfq/servo
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)
예제 #9
0
파일: update.py 프로젝트: 6br/servo
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)
예제 #10
0
    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)
예제 #11
0
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)
예제 #12
0
파일: update.py 프로젝트: rjhome/chromium-1
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)
예제 #13
0
    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)
예제 #14
0
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
예제 #15
0
 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"))
예제 #16
0
 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)
예제 #17
0
 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)
예제 #18
0
 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)
예제 #19
0
 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)