Skip to content

Commit

Permalink
Adapt parsing of soft-failure details on openQA >= 4.5.1528009330.e68…
Browse files Browse the repository at this point in the history
…ebe2b-3956-gfac9d6dc2

Newer openQA versions have removed again the internal route
"module_components_ajax" so we can not rely on that anymore. Instead we
can query the job details over the corresponding API route and "fake" a
module URL in the format that is expected by the caller of
"_get_url_to_softfailed_module". This is certainly a "lazy" approach to
adapt the code to the behaviour of recent openQA with the least amount
of necessary code change in openqa-review.

Related progress issue: https://progress.opensuse.org/issues/72292
  • Loading branch information
okurz committed Oct 13, 2020
1 parent d02138f commit 1091909
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions openqa_review/openqa_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,13 +888,10 @@ def total_issues(self):

def _get_url_to_softfailed_module(self, job_url):
log.debug('job_url %s' % job_url)
url = job_url + '/module_components_ajax'
try:
test_details_html = self.test_browser.get_soup(url).find(title='Soft Failed')
if test_details_html is None: # pragma: no cover
log.debug('Found older openQA, before https://github.com/os-autoinst/openQA/pull/3080')
url = job_url + '/details_ajax'
test_details_html = self.test_browser.get_soup(url).find(title='Soft Failed')
details = self.test_browser.get_json('/api/v1/jobs/' + job_url.split('/')[-1] + '/details')
# fake an older module URL including the name, see https://progress.opensuse.org/issues/72292
return format('///%s//' % [i for i in details['job']['testresults'] if i['result'] == 'softfailed'][0]['name']) # pragma: no cover
except DownloadError:
log.debug('Found older openQA, before https://github.com/os-autoinst/openQA/pull/2932')
url = job_url
Expand Down

0 comments on commit 1091909

Please sign in to comment.