This commit is contained in:
Jonathan Eads 2013-11-06 19:50:07 -08:00
Родитель 9897261392 768a26da1d
Коммит 42c7be37d6
5 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -31,6 +31,6 @@
}
],
"machine": "tegra-132",
"state": "finished",
"state": "completed",
"product_name": "mobile"
}, "revision_hash": "0686a4d3fa477cb0415c9ca590177e4b03919b64"}

Просмотреть файл

@ -35,7 +35,7 @@ def test_completed_job_available(jm, initial_data, completed_jobs_loaded):
jobs = resp.json
assert len(jobs) == 1
assert jobs[0]['state'] == 'finished'
assert jobs[0]['state'] == 'completed'
def test_pending_stored_to_running_loaded(jm, initial_data, pending_jobs_stored, running_jobs_stored):
@ -66,7 +66,7 @@ def test_finished_job_to_running(jm, initial_data, completed_jobs_loaded, runnin
jobs = resp.json
assert len(jobs) == 1
assert jobs[0]['state'] == 'finished'
assert jobs[0]['state'] == 'completed'
def test_running_job_to_pending(jm, initial_data, running_jobs_stored, pending_jobs_stored):

Просмотреть файл

@ -644,9 +644,12 @@ class JobsModel(TreeherderModelBase):
self._load_job_artifacts(artifact_placeholders, job_id_lookup)
# If there is already a job_guid stored with pending/running status
# If there is already a job_id stored with pending/running status
# we need to update the information for the complete job
if job_update_placeholders:
# replace job_guid with job_id
for row in job_update_placeholders:
row[-1] = job_id_lookup[row[-1]]['id']
self.get_jobs_dhub().execute(
proc='jobs.updates.update_job_data',
@ -816,7 +819,6 @@ class JobsModel(TreeherderModelBase):
start_timestamp,
end_timestamp,
job_state,
job_state,
job_guid
] )

Просмотреть файл

@ -141,8 +141,10 @@
`state` = ?,
`start_timestamp` = ?,
`end_timestamp` = ?
WHERE ( ( ? = 'completed' AND `state` != 'completed') OR
( ? = 'running' AND `state` = 'pending' ) ) AND `id` = ?",
WHERE
`state` != 'completed'
AND ? <> 'pending'
AND `id` = ?",
"host":"master_host"
}

Просмотреть файл

@ -304,7 +304,7 @@ class ResultSetViewSet(viewsets.ViewSet):
# platform and options
platform_grouper = lambda x: "{0} {1}".format(
x["platform"],
option_collections[x["option_collection_hash"]]
option_collections[x["option_collection_hash"]]['opt']
)
#itertools needs the elements to be sorted by the grouper