mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot: guess_result conversion to record api
This commit is contained in:
parent
297d502afd
commit
278d4ed449
@ -219,7 +219,8 @@ class runbot_build(models.Model):
|
|||||||
build.domain = "%s:%s" % (domain, build.port)
|
build.domain = "%s:%s" % (domain, build.port)
|
||||||
|
|
||||||
def _guess_result(self):
|
def _guess_result(self):
|
||||||
self.env.cr.execute("""
|
cr = self.env.cr
|
||||||
|
cr.execute("""
|
||||||
SELECT b.id,
|
SELECT b.id,
|
||||||
CASE WHEN b.state != 'testing' THEN b.result
|
CASE WHEN b.state != 'testing' THEN b.result
|
||||||
WHEN array_agg(l.level)::text[] && ARRAY['ERROR', 'CRITICAL'] THEN 'ko'
|
WHEN array_agg(l.level)::text[] && ARRAY['ERROR', 'CRITICAL'] THEN 'ko'
|
||||||
@ -231,7 +232,9 @@ class runbot_build(models.Model):
|
|||||||
WHERE b.id IN %s
|
WHERE b.id IN %s
|
||||||
GROUP BY b.id
|
GROUP BY b.id
|
||||||
""", [tuple(self.ids)])
|
""", [tuple(self.ids)])
|
||||||
return dict(self.env.cr.fetchall())
|
result = {row[0]: row[1] for row in cr.fetchall()}
|
||||||
|
for build in self:
|
||||||
|
build.guess_result = result[build.id]
|
||||||
|
|
||||||
def _get_time(self):
|
def _get_time(self):
|
||||||
"""Return the time taken by the tests"""
|
"""Return the time taken by the tests"""
|
||||||
|
Loading…
Reference in New Issue
Block a user