[autotest] Add test_retry field to afe_jobs table
Does what it says on the tin.
CQ-DEPEND=If8134fe263bb33ee5d52bc92e78faee05388b239
BUG=chromium-os:37158
TEST=database/migrate.py sync, ensure that jobs can still be viewed in
afe. Ensure that new column exists and is zeroed out for all jobs
already in db. Kick off a smoke suite and ensure that it runs.
Change-Id: I0790d60d7c86d9278507b46ae1579a7b72b20c5a
Reviewed-on: https://gerrit.chromium.org/gerrit/44427
Tested-by: Aviv Keshet <[email protected]>
Reviewed-by: Scott Zawalski <[email protected]>
Commit-Queue: Scott Zawalski <[email protected]>
Tested-by: Scott Zawalski <[email protected]>
diff --git a/frontend/afe/rpc_interface_unittest.py b/frontend/afe/rpc_interface_unittest.py
index e0ea971..a2087b3 100755
--- a/frontend/afe/rpc_interface_unittest.py
+++ b/frontend/afe/rpc_interface_unittest.py
@@ -1,10 +1,11 @@
+#pylint: disable-msg=C0111
#!/usr/bin/python
import datetime, unittest
import common
+#pylint: disable-msg=W0611
from autotest_lib.frontend import setup_django_environment
from autotest_lib.frontend.afe import frontend_test_utils
-from django.db import connection
from autotest_lib.frontend.afe import models, rpc_interface, frontend_test_utils
from autotest_lib.frontend.afe import model_logic, model_attributes
from autotest_lib.client.common_lib import global_config
@@ -112,6 +113,17 @@
self.assertEquals(jobs[0]['keyvals'], keyval_dict)
+ def test_test_retry(self):
+ job_id = rpc_interface.create_job(name='flake', priority='Medium',
+ control_file='foo',
+ control_type='Client',
+ hosts=['host1'],
+ test_retry=10)
+ jobs = rpc_interface.get_jobs(id=job_id)
+ self.assertEquals(len(jobs), 1)
+ self.assertEquals(jobs[0]['test_retry'], 10)
+
+
def test_get_jobs_summary(self):
job = self._create_job(hosts=xrange(1, 4))
entries = list(job.hostqueueentry_set.all())