Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 392fe48

Browse files
committed
Merge pull request #51 from lepistone/runbot-skip-test-jobs
Runbot skip test jobs
2 parents 60fe9e4 + 71a4426 commit 392fe48

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

runbot_build_instructions/README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ checked:
2424
build commands. A practical example of that is passing on a repository
2525
containing a clone of odoo to the custom build script. That script can for
2626
example make a local clone of odoo, saving both time and disk space.
27+
* An option allows to skip the standard test jobs. This is useful if the whole
28+
build phase is done in a custom script in the prebuild step.
2729

2830
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
2931
:alt: Try me on Runbot

runbot_build_instructions/__openerp__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'name': 'Runbot Custom Build and Run Instructions',
2525
'category': 'Website',
2626
'summary': 'Runbot with custom build and run instructions',
27-
'version': '1.2',
27+
'version': '1.3',
2828
'author': "Savoir-faire Linux,Odoo Community Association (OCA)",
2929
'depends': ['runbot'],
3030
'data': [

runbot_build_instructions/runbot_build.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from openerp.addons.runbot.runbot import mkdirs
3131

3232
_logger = logging.getLogger(__name__)
33+
MAGIC_PID_RUN_NEXT_JOB = -2
3334

3435

3536
def custom_build(func):
@@ -69,6 +70,27 @@ def job_00_init(self, cr, uid, build, lock_path, log_path):
6970
build.prebuilt = True
7071
return res
7172

73+
def job_10_test_base(self, cr, uid, build, lock_path, log_path):
74+
if build.branch_id.repo_id.skip_test_jobs:
75+
_logger.info('skipping job_10_test_base')
76+
return MAGIC_PID_RUN_NEXT_JOB
77+
else:
78+
return super(runbot_build, self).job_10_test_base(
79+
cr, uid, build, lock_path, log_path
80+
)
81+
82+
def job_20_test_all(self, cr, uid, build, lock_path, log_path):
83+
if build.branch_id.repo_id.skip_test_jobs:
84+
_logger.info('skipping job_20_test_all')
85+
with open(log_path, 'w') as f:
86+
f.write('consider tests as passed: '
87+
'.modules.loading: Modules loaded.')
88+
return MAGIC_PID_RUN_NEXT_JOB
89+
else:
90+
return super(runbot_build, self).job_20_test_all(
91+
cr, uid, build, lock_path, log_path
92+
)
93+
7294
def sub_cmd(self, build, cmd):
7395
if not cmd:
7496
return []

runbot_build_instructions/runbot_repo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
class RunbotRepo(models.Model):
3737
_inherit = "runbot.repo"
3838
is_custom_build = fields.Boolean('Custom Build')
39+
skip_test_jobs = fields.Boolean('Skip standard test jobs')
3940
custom_build_dir = fields.Char(
4041
'Custom Build Directory',
4142
help="Relative directory where repo will be checked out"

runbot_build_instructions/runbot_repo_view.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<group string="Params" position="after">
1313
<group name="custom">
1414
<field name="is_custom_build"/>
15+
<field name="skip_test_jobs"/>
1516
<field name="custom_build_dir" attrs="{'invisible': [('is_custom_build', '=', False)]}"/>
1617
<field name="custom_server_path" attrs="{'invisible': [('is_custom_build', '=', False)], 'required': [('is_custom_build', '=', True)]}"/>
1718
<field name="custom_server_params" attrs="{'invisible': [('is_custom_build', '=', False)]}"/>

0 commit comments

Comments
 (0)