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

Commit

Permalink
Merge pull request #51 from lepistone/runbot-skip-test-jobs
Browse files Browse the repository at this point in the history
Runbot skip test jobs
  • Loading branch information
guewen committed Aug 28, 2015
2 parents 60fe9e4 + 71a4426 commit 392fe48
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions runbot_build_instructions/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ checked:
build commands. A practical example of that is passing on a repository
containing a clone of odoo to the custom build script. That script can for
example make a local clone of odoo, saving both time and disk space.
* An option allows to skip the standard test jobs. This is useful if the whole
build phase is done in a custom script in the prebuild step.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
Expand Down
2 changes: 1 addition & 1 deletion runbot_build_instructions/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'name': 'Runbot Custom Build and Run Instructions',
'category': 'Website',
'summary': 'Runbot with custom build and run instructions',
'version': '1.2',
'version': '1.3',
'author': "Savoir-faire Linux,Odoo Community Association (OCA)",
'depends': ['runbot'],
'data': [
Expand Down
22 changes: 22 additions & 0 deletions runbot_build_instructions/runbot_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from openerp.addons.runbot.runbot import mkdirs

_logger = logging.getLogger(__name__)
MAGIC_PID_RUN_NEXT_JOB = -2


def custom_build(func):
Expand Down Expand Up @@ -69,6 +70,27 @@ def job_00_init(self, cr, uid, build, lock_path, log_path):
build.prebuilt = True
return res

def job_10_test_base(self, cr, uid, build, lock_path, log_path):
if build.branch_id.repo_id.skip_test_jobs:
_logger.info('skipping job_10_test_base')
return MAGIC_PID_RUN_NEXT_JOB
else:
return super(runbot_build, self).job_10_test_base(
cr, uid, build, lock_path, log_path
)

def job_20_test_all(self, cr, uid, build, lock_path, log_path):
if build.branch_id.repo_id.skip_test_jobs:
_logger.info('skipping job_20_test_all')
with open(log_path, 'w') as f:
f.write('consider tests as passed: '
'.modules.loading: Modules loaded.')
return MAGIC_PID_RUN_NEXT_JOB
else:
return super(runbot_build, self).job_20_test_all(
cr, uid, build, lock_path, log_path
)

def sub_cmd(self, build, cmd):
if not cmd:
return []
Expand Down
1 change: 1 addition & 0 deletions runbot_build_instructions/runbot_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
class RunbotRepo(models.Model):
_inherit = "runbot.repo"
is_custom_build = fields.Boolean('Custom Build')
skip_test_jobs = fields.Boolean('Skip standard test jobs')
custom_build_dir = fields.Char(
'Custom Build Directory',
help="Relative directory where repo will be checked out"
Expand Down
1 change: 1 addition & 0 deletions runbot_build_instructions/runbot_repo_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<group string="Params" position="after">
<group name="custom">
<field name="is_custom_build"/>
<field name="skip_test_jobs"/>
<field name="custom_build_dir" attrs="{'invisible': [('is_custom_build', '=', False)]}"/>
<field name="custom_server_path" attrs="{'invisible': [('is_custom_build', '=', False)], 'required': [('is_custom_build', '=', True)]}"/>
<field name="custom_server_params" attrs="{'invisible': [('is_custom_build', '=', False)]}"/>
Expand Down

0 comments on commit 392fe48

Please sign in to comment.