| |
@@ -45,7 +45,7 @@
|
| |
|
| |
@main.route('/events')
|
| |
def events():
|
| |
- events = db.session.query(Event).order_by(Event.created_at)
|
| |
+ events = db.session.query(Event).order_by(Event.created_at.desc())
|
| |
return render_template('list_events.html', events=events)
|
| |
|
| |
|
| |
@@ -61,16 +61,19 @@
|
| |
if cached is not None:
|
| |
return cached
|
| |
|
| |
- results = RDB_API.get_job(event.resultsdb_job_id)['results']
|
| |
-
|
| |
+ try:
|
| |
+ results_count = RDB_API.get_group(event.resultsdb_job_uuid)['results_count']
|
| |
+ results = RDB_API.get_results(groups=[event.resultsdb_job_uuid], limit=results_count)['data']
|
| |
+ except resultsdb_api.ResultsDBapiException:
|
| |
+ results = []
|
| |
# results is a list of dicts like this:
|
| |
# {
|
| |
# "href": "http://taskotron-local/resultsdb_api/api/v1.0/results/1510407",
|
| |
# "id": 1510407,
|
| |
- # "job_url": "http://taskotron-local/resultsdb_api/api/v1.0/jobs/115516",
|
| |
- # "log_url": null,
|
| |
+ # "groups": ["uuid"],
|
| |
+ # "ref_url": null,
|
| |
# "outcome": "PASSED",
|
| |
- # "result_data": {
|
| |
+ # "data": {
|
| |
# "bugs": [
|
| |
# ""
|
| |
# ],
|
| |
@@ -85,11 +88,11 @@
|
| |
# ]
|
| |
# },
|
| |
# "submit_time": "2015-05-14T09:20:36.392351",
|
| |
- # "summary": "Comment number 4",
|
| |
+ # "note": "Comment number 4",
|
| |
# "testcase": {
|
| |
# "href": "http://taskotron-local/resultsdb_api/api/v1.0/testcases/testdays_QA_Testcase_Power_Management_tuned_off_idle",
|
| |
# "name": "testdays_QA_Testcase_Power_Management_tuned_off_idle",
|
| |
- # "url": "http://fedoraproject.org/wiki/QA:Testcase_Power_Management_tuned_off_idle"
|
| |
+ # "ref_url": "http://fedoraproject.org/wiki/QA:Testcase_Power_Management_tuned_off_idle"
|
| |
# }
|
| |
# }
|
| |
|
| |
@@ -100,22 +103,22 @@
|
| |
# 'result': $result,
|
| |
# }]}}}
|
| |
#
|
| |
- # Where $username, $col_1, and $result are from ['result_data'],
|
| |
- # $tcurl is the testcase url from ['testcase']['url']
|
| |
+ # Where $username, $col_1, and $result are from ['data'],
|
| |
+ # $tcurl is the testcase url from ['testcase']['ref_url']
|
| |
|
| |
by_user = {}
|
| |
for result in results:
|
| |
- data = result['result_data']
|
| |
+ data = result['data']
|
| |
|
| |
username = data['username'][0]
|
| |
col_1 = data['col_1'][0]
|
| |
- tcurl = result['testcase']['url']
|
| |
+ tcurl = result['testcase']['ref_url']
|
| |
|
| |
outcome = data['result'][0]
|
| |
bugs = []
|
| |
if data['bugs'][0]:
|
| |
bugs = data['bugs'][0].split(';')
|
| |
- comment = result['summary']
|
| |
+ comment = result['note']
|
| |
|
| |
by_user.setdefault(username, {})
|
| |
by_user[username].setdefault(col_1, {})
|
| |
@@ -253,10 +256,10 @@
|
| |
profile=profile)
|
| |
|
| |
def testcase_to_name(testcase):
|
| |
- prefix = "testdays"
|
| |
+ prefix = "apps.testdays."
|
| |
name = testcase.url.split('/')[-1]
|
| |
name = RE_TESTCASE_NAME_NORMALIZE.sub('_', name)
|
| |
- return "%s_%s" % (prefix, name)
|
| |
+ return "%s%s" % (prefix, name)
|
| |
|
| |
def ensure_testcase(testcase):
|
| |
global TESTCASES
|
| |
@@ -309,14 +312,14 @@
|
| |
testcase_name = ensure_testcase(testcase)
|
| |
|
| |
result_dict = dict(
|
| |
- job_id=testcase.category.event.resultsdb_job_id,
|
| |
- testcase_name=testcase_name,
|
| |
outcome=outcome,
|
| |
+ testcase=testcase_name,
|
| |
+ groups=[testcase.category.event.resultsdb_job_uuid],
|
| |
+ note=form_.comment.data,
|
| |
result=form_.result.data,
|
| |
col_1=form_.col_1.data,
|
| |
username=form_.username.data,
|
| |
bugs=form_.bugs.data,
|
| |
- summary=form_.comment.data,
|
| |
)
|
| |
try:
|
| |
r = RDB_API.create_result(**result_dict)
|
| |
@@ -338,16 +341,3 @@
|
| |
form_action = url_for('.enter_result', event_id=event_id, tc_id=tc_id),
|
| |
header = "Enter result",
|
| |
)
|
| |
-
|
| |
-
|
| |
-
|
| |
-
|
| |
-
|
| |
-
|
| |
-
|
| |
-
|
| |
-
|
| |
-
|
| |
-
|
| |
-
|
| |
-
|
| |