def load_manifest(self, tests_path, manifest_path, metadata_path, url_base="/", **kwargs): cache_root = os.path.join(metadata_path, ".cache") if self.manifest_download: download_from_github(manifest_path, tests_path) return manifest.load_and_update(tests_path, manifest_path, url_base, cache_root=cache_root, update=self.force_manifest_update, meta_filters=self.meta_filters, types=self.types)
def load_manifest(self, tests_path, manifest_path, metadata_path, url_base="/", **kwargs): cache_root = os.path.join(metadata_path, ".cache") if self.manifest_download: download_from_github(manifest_path, tests_path) return manifest.load_and_update(tests_path, manifest_path, url_base, cache_root=cache_root, update=self.force_manifest_update, types=self.types)
def main(request, response): path = os.path.join(root, "MANIFEST.json") # TODO make this download rather than rebuilding from scratch when possible manifest_file = manifest.load_and_update(root, path, "/", parallel=False) supported_types = ["testharness", "reftest", "manual"] data = {"items": {}, "url_base": "/"} for item_type in supported_types: data["items"][item_type] = {} for item_type, path, tests in manifest_file.itertypes(*supported_types): tests_data = [] for item in tests: test_data = [item.url[1:]] if item_type == "reftest": test_data.append(item.references) test_data.append({}) if item_type != "manual": test_data[-1]["timeout"] = item.timeout tests_data.append(test_data) assert path not in data["items"][item_type] data["items"][item_type][path] = tests_data return [("Content-Type", "application/json")], json.dumps(data)
def load_manifest(manifest_path=None, manifest_update=True): # type: (Optional[str], bool) -> manifest.Manifest if manifest_path is None: manifest_path = os.path.join(wpt_root, "MANIFEST.json") return manifest.load_and_update(wpt_root, manifest_path, "/", update=manifest_update)
def create(self, state): from manifest import manifest state.manifest_path = os.path.join(state.metadata_path, "MANIFEST.json") state.test_manifest = manifest.load_and_update(state.sync["path"], state.manifest_path, "/", write_manifest=True)
def load_manifest(manifest_path=None, manifest_update=True): # Delay import after localpaths sets up sys.path, because otherwise the # import path will be "..manifest" and Python will treat it as a different # manifest module. from manifest import manifest if manifest_path is None: manifest_path = os.path.join(wpt_root, "MANIFEST.json") return manifest.load_and_update(wpt_root, manifest_path, "/", update=manifest_update)
def load_manifest(): root = localpaths.repo_root path = os.path.join(root, "MANIFEST.json") manifest_file = manifest.load_and_update(root, path, "/", parallel=False) supported_types = ["testharness", "manual"] data = {"items": {}, "url_base": "/"} for item_type in supported_types: data["items"][item_type] = {} for item_type, path, tests in manifest_file.itertypes(*supported_types): tests_data = [] for item in tests: test_data = [item.url[1:]] if item_type == "reftest": test_data.append(item.references) test_data.append({}) if item_type != "manual": test_data[-1]["timeout"] = item.timeout tests_data.append(test_data) assert path not in data["items"][item_type] data["items"][item_type][path] = tests_data return data
def manifest_update(test_paths): from manifest import manifest # type: ignore for url_base, paths in test_paths.items(): manifest.load_and_update(paths["tests_path"], paths["manifest_path"], url_base)