Beispiel #1
0
 def test_from_component_dist(self):
     check_list = CiCheckLists.from_component(
         InputComponentFromDist({
             "name": "common-utils",
             "dist": "url"
         }), None)
     self.assertIs(type(check_list), CiCheckListDist)
Beispiel #2
0
 def test_from_component_source(self):
     check_list = CiCheckLists.from_component(
         InputComponentFromSource({
             "name": "common-utils",
             "repository": "url",
             "ref": "ref"
         }), None)
     self.assertIs(type(check_list), CiCheckListSource)
    def __check__(self):

        target = CiTarget(version=self.manifest.build.version,
                          name=self.manifest.build.filename,
                          snapshot=self.args.snapshot)

        with TemporaryDirectory(keep=self.args.keep, chdir=True) as work_dir:
            logging.info(f"Sanity-testing in {work_dir.name}")

            logging.info(f"Sanity testing {self.manifest.build.name}")

            for component in self.manifest.components.select(
                    focus=self.args.component):
                logging.info(f"Sanity testing {component.name}")

                ci_check_list = CiCheckLists.from_component(component, target)
                ci_check_list.checkout(work_dir.name)
                ci_check_list.check()
                logging.info("Done.")
 def test_from_component_invalid(self) -> None:
     with self.assertRaises(ValueError) as ctx:
         CiCheckLists.from_component(self, None)
     self.assertTrue(str(ctx.exception).startswith("Invalid component type: "))