mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot: check restore result
This commit is contained in:
parent
1879f2c235
commit
77f8c29091
@ -721,6 +721,7 @@ class ConfigStep(models.Model):
|
|||||||
'rm -r restore',
|
'rm -r restore',
|
||||||
'echo "### listing modules"',
|
'echo "### listing modules"',
|
||||||
"""psql %s -c "select name from ir_module_module where state = 'installed'" -t -A > /data/build/logs/restore_modules_installed.txt""" % restore_db_name,
|
"""psql %s -c "select name from ir_module_module where state = 'installed'" -t -A > /data/build/logs/restore_modules_installed.txt""" % restore_db_name,
|
||||||
|
'echo "### restore" "successful"', # two part string to avoid miss grep
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -872,6 +873,9 @@ class ConfigStep(models.Model):
|
|||||||
build_values.update(self._make_tests_results(build))
|
build_values.update(self._make_tests_results(build))
|
||||||
elif self.job_type == 'test_upgrade':
|
elif self.job_type == 'test_upgrade':
|
||||||
build_values.update(self._make_upgrade_results(build))
|
build_values.update(self._make_upgrade_results(build))
|
||||||
|
elif self.job_type == 'restore':
|
||||||
|
build_values.update(self._make_restore_results(build))
|
||||||
|
|
||||||
return build_values
|
return build_values
|
||||||
|
|
||||||
def _make_python_results(self, build):
|
def _make_python_results(self, build):
|
||||||
@ -966,6 +970,13 @@ class ConfigStep(models.Model):
|
|||||||
return 'ko'
|
return 'ko'
|
||||||
return 'ok'
|
return 'ok'
|
||||||
|
|
||||||
|
def _check_restore_ended(self, build):
|
||||||
|
log_path = build._path('logs', '%s.txt' % self.name)
|
||||||
|
if not grep(log_path, "### restore successful"):
|
||||||
|
build._log('_make_tests_results', 'Restore failed, check text logs for more info', level="ERROR")
|
||||||
|
return 'ko'
|
||||||
|
return 'ok'
|
||||||
|
|
||||||
def _get_log_last_write(self, build):
|
def _get_log_last_write(self, build):
|
||||||
log_path = build._path('logs', '%s.txt' % self.name)
|
log_path = build._path('logs', '%s.txt' % self.name)
|
||||||
if os.path.isfile(log_path):
|
if os.path.isfile(log_path):
|
||||||
@ -996,6 +1007,17 @@ class ConfigStep(models.Model):
|
|||||||
build_values['local_result'] = build._get_worst_result([build.local_result, local_result])
|
build_values['local_result'] = build._get_worst_result([build.local_result, local_result])
|
||||||
return build_values
|
return build_values
|
||||||
|
|
||||||
|
def _make_restore_results(self, build):
|
||||||
|
build_values = {}
|
||||||
|
if build.local_result != 'warn':
|
||||||
|
checkers = [
|
||||||
|
self._check_log,
|
||||||
|
self._check_restore_ended
|
||||||
|
]
|
||||||
|
local_result = self._get_checkers_result(build, checkers)
|
||||||
|
build_values['local_result'] = build._get_worst_result([build.local_result, local_result])
|
||||||
|
return build_values
|
||||||
|
|
||||||
def _make_stats(self, build):
|
def _make_stats(self, build):
|
||||||
if not self.make_stats: # TODO garbage collect non sticky stat
|
if not self.make_stats: # TODO garbage collect non sticky stat
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user