mirror of
https://github.com/odoo/runbot.git
synced 2025-03-30 14:55:45 +07:00

When a build is done, various numerical informations could be extracted from log files. e.g.: global query count or tests query count ... The extraction regular expression could be hard-coded in a custom step but there is no place holder where to store the retrieved information. In order to compare results, we need to store it. With this commit, a new model `runbot.build.stat` is used to store key/values pair linked to a build/config_step. That way, extracted values can be stored. Also, another `runbot.build.stat.regex` is used to store regular expressions that can be used to grep log files and extract values. The regular expression must contain a named group like this: `(?P<value>.+)` The text catched by this group MUST be castable into a float. Optionally, another named group can be used in the regular expresion like this: `(?P<key>.+)` This `key` group will then be used to augment the key name in the database. Example: Consider a log line like this one: `odoo.addons.website_blog.tests.test_ui tested in 10.35s` A regular expression like this, named `test_duration`: `odoo.addons.(?P<key>.+) tested in (?P<value>\d+\.\d+)s` Should store the following key:value: `{ 'key': 'test_duration.website_blog.tests.test_ui', 'value': 10.35 }` A `generic` boolean field is present on the build.stat.regex object, meaning that when no regex are linked to a make_stats config step, then, all the generic regex will be applied. A wizard is added to help the creation the regular expressions, allowing to test if they work against a user provided example. A _make_stats method is added to the ConfigStep model which is called during the _schedule of a build, just before calling the next step. The regex search is only apllied in steps that have the `make_stats` boolean field set to true. Also, the build branch have to be flagged `make_stats` too or the build can have a key `make_stats` in its config_data field. The `make_stats` field on the branch is a compute stored field. That way, sticky branches are automaticaly set `make_stats' true. Finally, an SQL view is used to facilitate the stats visualisation.
15 lines
320 B
Python
15 lines
320 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from . import repo
|
|
from . import branch
|
|
from . import build
|
|
from . import event
|
|
from . import build_dependency
|
|
from . import build_config
|
|
from . import ir_cron
|
|
from . import host
|
|
from . import build_error
|
|
from . import build_stat
|
|
from . import build_stat_regex
|
|
from . import res_config_settings
|