View source | Discuss this page | Page history | Printable version   

ERP module integration with CI

Contents

Introduction

Openbravo 2.50 comes with the new concept of Modularity: the ability for developers to build, package and distribute Extension Modules and for users to install, uninstall and update Extension Modules.

This documents explains on how to check and test the development phase of each modules using continuous Integration farm. Which helps in fast tracking the status of module build, installation, test and publish

Life Cycle

Module once enters in to development phase, it is necessary it undergoes following stages before it get published in Central Repository for customers

Note: Upgrade test can be done once the module has first version published in CR

Sanity check

This is the basic check mandatory for all the modules, it checks for the following items and alerts the ones which do not meet the required criteria

License Audit:

* Copyright (C) 2010 Openbravo S.L.U.
* Licensed under the Openbravo Commercial License version 1.0
* You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html 
* or in the legal folder of this module distribution.

Other Checks:

Note: It is necessary to take care of these items in modules development to avoid failure during integration process.

Compilation and Create OBX

This stage is to check for the source compilation and on success create obx. Below is the work flow of this stage

Prerequisite

Note: One can go for SCM option, When the AD_MODULE_DEPENDENCY.xml is specified with appropriate dependency list, else opt for OBX that are published in CR.

Process

Now the obx is available to download from here

Database consistency check

This is to check the database consistency after including the module.

Process

JUnit test

Check for the JUnit inside module

Prequisite

How to invoke JUnit in CI

On satisfying the perquisite above invoke the jUnit as below

Example: ant -f $WORKSPACE/erp_source/modules/$MOD_NAME/build.xml test

Install and Uninstall of module

On completing the stage-2 the obx is available with latest changeset of the module and ready to check the installation and uninstallation

Prerequisite

Process

Selenium test

Here is to run any selenium test for modules

Prerequisite

Process

Check Module Update

This check is performed when the module has at-least one published version in CR

Prerequisite

Process

Create New Jobs in hudson CI for modules

New job

Template job is available in hudson, to create a new job

with this a new job will be created for your module

Note: No space and dot are allowed in the job name, example of jobname assertreport, assest_report

Configuration

Now the job need to be configured to have details about the modules and frequency in which it has to be triggered etc

Browse to the new job configuration new job's configure window

Generic Settings

 Setting this is similar to cronjob setting 
 Example: # To execute the job daily at 3 am
 0 3 * * * 

Module specific settings

This is to set which is the script to be executed and what inputs to be given to the scripts Specify the module type either it is public or commercial module, please enable/comment the token accordingly

#export MOD_TYPE="public"
#export MOD_TYPE="private"

Specify the Modules project name here as specified in forge and uncomment the token (this variable is required for sanity check).

#export MOD_PRO_NAME=

Specify the module you want to monitor, the name as specified in SCM

# Example : export MOD_NAME="org.openbravo.userinterface.selector"
export MOD_NAME="org.openbravo.userinterface.selector"

Please specify which selenium repo for to be referred for selenium test classes.

export SMOKE_REPO=pi-ci

Please specify the source repo for ERP

export SOURCE_REPO=pi-engdev

Please specify the dependency type if you want to include. Uncomment the token appropriate for you. The dependency from source then specify as "scm", note this works only when AD_MODULE_DEPENDENCY.xml has all the dependency set init. If you want to pull the latest published version of modules then specify as 'obx'

#export DEP_TYPE="scm"
#export DEP_TYPE="obx"

Please specify the project names of the modules as in forge, this is mantary when u specify OBX

# Example export DEPENDENT_MODULES="obsmartclient openbravoseam Openbravoclientkernel openbravoclientfreemarker DatasourceService openbravojsonrest"

Sanity check of the module.

sh /srv/hudson_setup/module_integration/sanity-check.sh

Database consistency check

sh /srv/hudson_setup/module_integration/dbconsistency

JUnit tests for module

ant -f $WORKSPACE/erp_source/modules/$MOD_NAME/build.xml test

Post build Action

SANDBOX/automation/pi/last-results/*/logs/*.xml

How to Debug

Here are simple guidelines on how to check the status of job and error logs

Build Failure

http://modules.builds.openbravo.com/job/<JOB_NAME>/<BUILD_NUMBER>/consoleFull 

Note: Replace the JOB_NAME and BUILD_NUMBER with your job

Selenium Failure

Selenium Failure here is the test like installation, un-installation, upgrade of modules are checked the via the ERP application web interface and we use selenium for it. The status of these test are recored using selenium test scripts. Below are how to check them

http://modules.builds.openbravo.com/job/<JOB_NAME>/ws/SANDBOX/automation/pi-engdev/last-results/
http://modules.builds.openbravo.com/job/<job_name>/ws/SANDBOX/automation/<automation-repo>/last-results/

Script reference

Next steps

Retrieved from "http://wiki.openbravo.com/wiki/ERP_module_integration_with_CI"

This page has been accessed 14,346 times. This page was last modified on 14 December 2010, at 06:08. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.