def test_validate_upstream_jobs_valid(self):
     saasherder = SaasHerder(
         self.saas_files,
         thread_pool_size=1,
         gitlab=None,
         integration="",
         integration_version="",
         settings={},
         validate=True,
     )
     saasherder.validate_upstream_jobs(self.jjb)
     self.assertTrue(saasherder.valid)
 def test_validate_upstream_jobs_invalid(self):
     saasherder = SaasHerder(
         self.saas_files,
         thread_pool_size=1,
         gitlab=None,
         integration="",
         integration_version="",
         settings={},
         validate=True,
     )
     jjb = MockJJB({"ci": []})
     saasherder.validate_upstream_jobs(jjb)
     self.assertFalse(saasherder.valid)
예제 #3
0
def run(dry_run):
    saas_files = queries.get_saas_files(v1=True, v2=True)
    settings = queries.get_app_interface_settings()
    saasherder = SaasHerder(
        saas_files,
        thread_pool_size=1,
        gitlab=None,
        integration=QONTRACT_INTEGRATION,
        integration_version=QONTRACT_INTEGRATION_VERSION,
        settings=settings,
        validate=True,
    )
    app_int_repos = queries.get_repos()
    missing_repos = [r for r in saasherder.repo_urls if r not in app_int_repos]
    for r in missing_repos:
        logging.error(f"repo is missing from codeComponents: {r}")
    jjb, _ = init_jjb()
    saasherder.validate_upstream_jobs(jjb)
    if not saasherder.valid or missing_repos:
        sys.exit(ExitCodes.ERROR)