Пример #1
0
    def update_manifest(self, manifest_path, tests_path, url_base="/",
                        recreate=False, download=False):
        self.logger.info("Updating test manifest %s" % manifest_path)

        json_data = None
        if download:
            # TODO: make this not github-specific
            download_from_github(manifest_path, tests_path)

        if not recreate:
            try:
                with open(manifest_path) as f:
                    json_data = json.load(f)
            except IOError:
                self.logger.info("Unable to find test manifest")
            except ValueError:
                self.logger.info("Unable to parse test manifest")

        if not json_data:
            self.logger.info("Creating test manifest")
            manifest_file = manifest.Manifest(url_base)
        else:
            try:
                manifest_file = manifest.Manifest.from_json(tests_path, json_data)
            except manifest.ManifestVersionMismatch:
                manifest_file = manifest.Manifest(url_base)

        manifest_update.update(tests_path, manifest_file, True)

        manifest.write(manifest_file, manifest_path)
Пример #2
0
    def update_manifest(self, manifest_path, tests_path, url_base="/",
                        recreate=False, download=False):
        self.logger.info("Updating test manifest %s" % manifest_path)
        manifest_log.setup()

        json_data = None
        if download:
            # TODO: make this not github-specific
            download_from_github(manifest_path, tests_path)

        if not recreate:
            try:
                with open(manifest_path) as f:
                    json_data = json.load(f)
            except IOError:
                self.logger.info("Unable to find test manifest")
            except ValueError:
                self.logger.info("Unable to parse test manifest")

        if not json_data:
            self.logger.info("Creating test manifest")
            manifest_file = manifest.Manifest(url_base)
        else:
            try:
                manifest_file = manifest.Manifest.from_json(tests_path, json_data)
            except manifest.ManifestVersionMismatch:
                manifest_file = manifest.Manifest(url_base)

        manifest_update.update(tests_path, manifest_file, True)

        manifest.write(manifest_file, manifest_path)
Пример #3
0
    def update_manifest(self, manifest_path, tests_path, url_base="/",
                        recreate=False, download=False):
        self.logger.info("Updating test manifest %s" % manifest_path)
        manifest_log.setup()

        json_data = None
        if download:
            # TODO: make this not github-specific
            download_from_github(manifest_path, tests_path)

        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(url_base)
        else:
            try:
                manifest_file = manifest.Manifest.from_json(tests_path, json_data)
            except manifest.ManifestVersionMismatch:
                manifest_file = manifest.Manifest(url_base)

        manifest_update.update(tests_path, manifest_file, True)

        manifest.write(manifest_file, manifest_path)
Пример #4
0
 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)
Пример #5
0
 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 update_manifest(self,
                        manifest_path,
                        tests_path,
                        url_base="/",
                        recreate=False,
                        download=False):
        self.logger.info("Updating test manifest %s" % manifest_path)
        manifest_log.setup()

        json_data = None
        if download:
            # TODO: make this not github-specific
            download_from_github(manifest_path, tests_path)

        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(url_base)
        else:
            try:
                manifest_file = manifest.Manifest.from_json(
                    tests_path, json_data)
            except manifest.ManifestVersionMismatch:
                manifest_file = manifest.Manifest(url_base)

        manifest_update.update(tests_path, manifest_file, True)

        manifest.write(manifest_file, manifest_path)