Add failed tests to rss

This commit adds failed tests to RSS. It could be useful to understand
the reason of failures.

Change-Id: Ib1acb636bad352da649b9cca1294462e41bd62be
This commit is contained in:
Masayuki Igawa 2017-03-13 14:43:25 +09:00
parent 92465806ed
commit 82c298518b
No known key found for this signature in database
GPG Key ID: 251CCDE9053850E4
1 changed files with 7 additions and 0 deletions

View File

@ -479,6 +479,8 @@ def get_recent_failed_runs_rss(run_metadata_key, value):
return abort(make_response(msg, 404))
for run in failed_runs:
meta = api.get_run_metadata(run.uuid, session=session)
failing_test_runs = api.get_failing_from_run(run.id,
session=session)
uuid = [x.value for x in meta if x.key == 'build_uuid'][0]
build_name = [x.value for x in meta if x.key == 'build_name'][0]
entry = fg.add_entry()
@ -495,6 +497,11 @@ def get_recent_failed_runs_rss(run_metadata_key, value):
metadata_url)
content += '<li><a href="%s">Job Page</a></li>' % (job_url)
content += '</ul>'
content += '<h3>Failed tests</h3>'
content += '<ul>'
for failing_test_run in failing_test_runs:
content += '<li>%s</li>' % (failing_test_run.test.test_id)
content += '</ul>'
entry.description(content)
response = make_response(feeds[run_metadata_key][value].rss_str())
response.headers['Content-Type'] = 'application/xml; charset=utf-8'