Skip to content

Commit

Permalink
Merge pull request #3026 from dirkmueller/filter_tests_arch
Browse files Browse the repository at this point in the history
Only check for products to be built successfully
  • Loading branch information
Vogtinator authored Oct 26, 2023
2 parents 4331902 + ad0217e commit 2891f13
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gocd/bci_repo_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ def openqa_jobs_for_product(self, arch, version, build):
}
return self.openqa.openqa_request('GET', 'jobs', values)['jobs']

def is_repo_published(self, project, repo):
def is_repo_published(self, project, repo, arch=None):
"""Validates that the given prj/repo is fully published and all builds
have succeeded."""
url = makeurl(self.apiurl, ['build', project, '_result'],
{'view': 'summary', 'repository': repo})
result_filter = {'view': 'summary', 'repository': repo}
if arch:
result_filter['arch'] = arch
url = makeurl(self.apiurl, ['build', project, '_result'], result_filter)
root = ET.parse(http_GET(url)).getroot()
for result in root.findall('result'):
if result.get('dirty', 'false') != 'false':
Expand All @@ -79,7 +81,7 @@ def is_repo_published(self, project, repo):
def run(self, version, token=None):
build_prj = f'SUSE:SLE-{version}:Update:BCI'

if not self.is_repo_published(build_prj, 'images'):
if not self.is_repo_published(build_prj, 'images', 'local'):
self.logger.info(f'{build_prj}/images not successfully built')
return

Expand Down

0 comments on commit 2891f13

Please sign in to comment.