Continuous Integration

From Koha Wiki

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

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


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:

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

Zoom on Koha_Master job :

  • 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

Koha's manuals are done with Sphinx and built and deployed using gitlab ci. See: gitlab-ci.yml

Good practices

Developer handbook

Personal tools