From version < 30.1 >
edited by Vincent Massol
on 2019/10/16 13:35
To version < 31.1 >
edited by Vincent Massol
on 2019/10/16 14:00
< >
Change comment: There is no comment for this version



Page properties
... ... @@ -180,6 +180,8 @@
180 180  {{code}}
181 181  sudo vi /etc/ssh/sshd_config
182 182  {{/code}}
183 +
184 +Then reload sshd: {{code}}sudo /etc/init.d/sshd reload{{/code}}
183 183  )))
184 184  
185 185  **Connect to the XVNC server**


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
  • Supports passing custom job properties. See below for an example of how to use this to trigger nightly build of Docker-based configuration tests.

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
 * 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:

// 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]") _
// See for details.

xwikiModule {

For more elaborate configuration, see:

Nightly Configuration Tests

Heres an example of how you can setup your Jenkinsfile to automatically have execution of Docker-based configuration tests every night. This example is taken from xwiki-platform's Jenkinsfile. For more details see this blog post.

  • Step 1: In the xwikiBuild step, pass the jobProperties configuration with some scheduler cron. For example:
    xwikiBuild( {
      jobProperties = getCustomJobProperties()

    private def getCustomJobProperties()
     // Define a scheduler job to execute the Docker-based functional tests at regular intervals. We do this since they
     // take time to execute and thus we cannot run them all the time.
     // This scheduler job will pass the "type" parameter to this Jenkinsfile when it executes, allowing us to decide if
     // we run the standard builds or the docker ones.
     // Note: it's the xwikiBuild() calls from the standard builds that will set the jobProperties and thus set up the
     // job parameter + the crons. It would be better to set the properties directly in this Jenkinsfile but we haven't
     // found a way to merge properties and calling the properties() step will override any pre-existing properties.
     return [
        parameters([string(defaultValue: 'standard', description: 'Job type', name: 'type')]),
          parameterizedCron('''@midnight %type=docker-latest
    @weekly %type=docker-all
    @monthly %type=docker-unsupported'''
  • Step 2: Based on the parametrized type value, decide to execute Docker-based tests:
    if (params.type && params.type == 'docker-latest') {
    private void buildDocker(type)
     def dockerConfigurationList
     def dockerModuleList
     def customJobProperties
     node() {
       // Checkout platform to find all docker configurations and test modules so that we can then parallelize executions
       // of configs and modules across Jenkins agents.
       checkout skipChangeLog: true, scm: scm
        dockerConfigurationList = dockerConfigurations(type)
       if (type == 'docker-unsupported') {
          dockerModuleList = ['xwiki-platform-core/xwiki-platform-menu']
       } else {
          dockerModuleList = dockerModules()
        customJobProperties = getCustomJobProperties()

      xwikiDockerBuild {
        configurations = dockerConfigurationList
        modules = dockerModuleList
       // Make sure that we don't reset the job properties!
       jobProperties = customJobProperties

Pros/Cons of this approach (which is needed because Jenkins doesn't support more than one Jenkinsfile) vs using a separate job:

  • Pros:
    • No need to handle branches, done automatically by the Jenkinsfile (creation and deletion). Also works for PRs.
  • Cons:
    • Jenkins build history gets a bit messed up, because you're reusing the same job name but running possibly different builds. For example, test failure age will get reset every time a different type of build is ran, but at least individual test history is kept.

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]

Maintainer's guide


  • You need to have an account on (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

Functional tests


Start remote Firefox

  • For example, to start firefox on machine ks4: ssh -X <username>@<ks4 hostname>
    • For this to work you need to ensure that X11Forwarding is set to yes in /etc/ssh/sshd_config on the remote machine:
      sudo vi /etc/ssh/sshd_config

      Then reload sshd: sudo /etc/init.d/sshd reload

Connect to the XVNC server

  • Establish a SSH tunnel between your computer and the server on port 5901 (ssh -L 5901:localhost:5901 )
  • 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
    • ssh -L 5901: -o ProxyCommand="ssh [email protected] nc -w1 %h %p" hudsonagent@ -i ~/.ssh/id_rsa_mavenxwikiorg
    • Where /.ssh/id_rsa_mavenxwikiorg is the private key on, used to connect to (ip of agent 2-4 in this example)
    • Not working yet since I can't connect with my local vnc client.

Get Connected