Continuous Integration

From Koha Wiki

Jump to: navigation, search
Home
Koha > Technical > Development > Quality Assurance Testing

This documentation needs reviewed (written during kohacon12 after Chris(c) presentation).

Contents

In general

Continuous Integration is when you automatically build things (unit test, documentation or whatever else) each time a commit is done and system provide notification for each fail.

In Koha

The tool which provide CI server is Jenkins: http://jenkins.koha-community.org/

One line is called a job with its characteristics: name / git branch built / scripts ran / etc.

Zoom on Koha_Master job : http://jenkins.koha-community.org/job/Koha_master/

  • Build history on the left shows built failed (red) and success
  • Each time a build failed, a notification by mail is sent to RM and the person who breaks the build
  • HTML_Report gives the cover of tests by file / sub

Other tools

#!/bin/bash -x                                                                  
#                                                                                                                                                                                                                                                                                                          
# Don't forget to run autoconf and ./configure, if that's what your project          
# needs.                                                 
                           
make clean   
source install_misc/environment_Makefile.PL || exit 1      
perl Makefile.PL                                                                                                             
                                                                                                                             
# Actually build the project                                                                 
make || exit 3 

export KOHA_CONF=/var/lib/jenkins/jobs/Koha_master/workspace/blib/KOHA_CONF_DIR/koha-conf.xml
export PERL5LIB=/var/lib/jenkins/jobs/Koha_master/workspace
export TEST_QA=1
prove_cover t/ t/db_dependent/ t/db_dependent/Labels xt/author/icondirectories.t xt/author/podcorrectness.t xt/author/translatable-templates.t xt/author/valid-templates.t xt/permissions.t xt/tt_valid.t --harness=TAP::Harness::JUnit
cover -report clover
measureperl-checkstyle --max_sub_lines 100 --max_sub_mccabe_complexity 10 --directory C4/ > checkstyle-result.xml

  • Slaves can be setup for helping the server for building (take +40-50 minutes) or run your own jobs

Koha Documentation

All active branches of Koha's manual are tested as well for conformance with the DocBook DTD. A build slave for testing documentation should have the following packages installed:

  • libxml2-utils (to provide xmllint)
  • docbook-xml (to provide the DocBook DTDs; having them in the slave's XML catalog prevents test failures that can occur when http://www.oasis-open.org/ rate-limits fetching the DTDs online.)


Good practices

Developer handbook

Personal tools