General

XWiki has a Continuous Integration setup to ensure XWiki's code is built at all times (i.e at every code check in). This also allows developers to only build the module they want and they'll have the other XWiki module dependencies downloaded from the XWiki remote repository.

We use the following tools:

We use a technique called binary dependency build which allows to check out only the module a developer wishes to work on and he'll automatically get the latest fresh binary dependencies built by our CI tool.

Jenkins Agent Image

XWiki has its own Jenkins Agent Docker image that is used by Jenkins master to spawn agents.

Jenkins Pipelines

Main Pipeline

We have developed a Jenkins Pipeline script to build XWiki projects (can be used for core and contrib projects). It has the following features:

  • Automatically use the right version of Java (and proper memory configuration)
  • Use Jenkins's Xvnc plugin to have a Display for functional tests
  • Use the "deploy" maven goal for "master" and "stable-*" branches only and "install" for the rest
  • Attach the screenshot of a failing XWiki Selenium test to the failed test's description
  • Check for false positives for known cases of failures not related to code + check for test flickers
  • Send mails for build failures

Note that if you use a "Github Organization" job type in Jenkins you'll get branch management for free, i.e. automatically build branches when new branches are added (or Pull Requests), and automatically stop building branches when they are removed from the SCM.

To use is for a project, add a Jenkinsfile with the following minimal configuration:

/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */


// It's assumed that Jenkins has been configured to implicitly load the vars/xwikiModule.groovy library which exposes
// the "xwikiModule" global function/DSL.
// Note that the version used is the one defined in Jenkins but it can be overridden as follows:
// @Library("[email protected]<branch, tag, sha1>") _
// See https://github.com/jenkinsci/workflow-cps-global-lib-plugin for details.

xwikiModule {
}

For more elaborate configuration, see:

Clover Pipeline

Used to generate the global test coverage for XWiki (over all XWiki Standard repositories). See Test Coverage.

Example usage:

import org.xwiki.jenkins.Clover
node('docker') {
   new Clover().generateGlobalCoverage([
       [baseline: "20171222-1835", fail: false],
       [baseline: "20190101-2330", fail: true]
   ])
}

Docker Pipeline

Used to run functional tests using Docker in various supported configurations. See the defined Jobs.

Example usage:

import org.xwiki.jenkins.DockerTests

def branchNames = ['master', 'stable-10.11.x']
def branches = [:]

branchNames.each() {
  branches[it] = {
   def label
   if (it.contains('10.11.x')) {
      label = 'docker-outside-docker'
   } else {
      label = 'docker'
   }
    node(label) {
     new DockerTests().executeDockerSupportedTests(it)
   }
 }
}

parallel branches

Maintainer's guide

Prerequisites

  • You need to have an account on maven.xwiki.org (this is the machine hosting XWiki's remote repository) and you'll need a key setup on your account there so that you can ssh to it without having to enter username or password.
  • You need to have an administrator account on ci.xwiki.org.

Functional tests

Debugging

Connect to the XVNC server

  • Establish a SSH tunnel between your computer and the server on port 5901 (ssh -L 5901:localhost:5901 <[email protected] address>)
  • Use your favorite VNC client to connect to the XVNC server
    • Host : localhost
    • Display : 1
    • Password : same password as for XWiki SAS wifi access points
  • See the functional tests live.
  • Work in progress to try to connect to an agent not exposing an IP address externally (by going through maven.xwiki.org):
    • ssh -L 5901:192.168.1.119:5901 -o ProxyCommand="ssh [email protected] nc -w1 %h %p" hudsonagent@192.168.1.119 -i ~/.ssh/id_rsa_mavenxwikiorg
    • Where /.ssh/id_rsa_mavenxwikiorg is the private key on maven.xwiki.org, used to connect to 192.168.1.119 (ip of agent 2-4 in this example)
    • Not working yet since I can't connect with my local vnc client.
Tags:
Created by Jean-Vincent Drean on 2008/10/14 18:54
   

Get Connected