SlideShare a Scribd company logo
1 of 42
Download to read offline
27 au 29 mars 2013Vincent Massol,April 2019
Building XWiki
Vincent Massol
• CTO XWiki SAS
• Open source developer
• My Projects
• XWiki (community-driven open source project)
• Past: Maven,Apache Cargo,Apache Cactus, Pattern Testing
• Other Credentials:
• LesCastCodeurs podcast about Java news
• Creator of OSSGTP open source group in Paris
• 3 books: JUnit in Action, Maven:A Developer’s Notebook, BBWM
Agenda
• Part 0: XWiki
• The project
• Part 1:The XWiki Build
• Automated quality checks
• Different types of tests
• Part 2:The CI (Jenkins)
• The various XWiki pipelines
• Part 3: Release Process
• Putting it all together
• Future
Agenda
• Part 0: XWiki
• The project
• Part 1:The XWiki Build
• Automated quality checks
• Different types of tests
• Part 2:The CI (Jenkins)
• The various XWiki pipelines
• Part 3: Release Process
• Putting it all together
• Future
What is XWiki? (1/2)
• A structured open source enterprise wiki
What is XWiki? (2/2)
• A platform for developing content-based web applications
Project Stats
Source: http://dev.xwiki.org/xwiki/bin/view/Community/ProjectHealth
Motivation
• Change the world!
• Needs impact
• Needs max number of users
• Open source
• Needs to show progress
• Release often
• Needs developers / contributors
• Community-driven
• Requires Time-boxing
• XWiki releases every month (3
weeks for RC1, 1w for final)
• Requires integration between all
parts
• Requires CI tool
• Requires quality-control
• Requires automated Tests
• Requires releases as automated as
possible
• Requires automated Build
• Requires good communication
Global Development Workflow
Governance
• Complete separation from
XWiki SAS and XWiki.org
• Only individuals working on the
open source project
• Rules similar to the ASF
• Committership, voting (0, +1, -1),
lazy consensus
• xwiki.org governance and
company advertising:
sponsoring companies
Source: http://dev.xwiki.org/xwiki/bin/view/Community/Governance
Agenda
• Part 0: XWiki
• The project
• Part 1: The XWiki Build
• Automated quality checks
• Different types of tests
• Part 2:The CI (Jenkins)
• The various XWiki pipelines
• Part 3: Release Process
• Putting it all together
• Future
Build
• Maven-based with several custom
plugins
• Active Quality vs Passive Quality.
• Strategy: if it’s not in the build it
doesn’t exist!
• Common to everyone
• If something is important it must fail
the build, otherwise it’s not important
• Try to reduce CI code to the
maximum for local reproducibility and
to be less tied to the CI
Source: http://dev.xwiki.org/xwiki/bin/view/Community/Building
Build = implement quality
Automated Checks
• Standard ones: compilation, tests, javadoc linter, etc
• Test execution: unit, functional, configuration,WCAG, HTML
validation
• Backward compatibility checks
• Code quality checks
• Best practices checks
• Test coverage checks
• Test quality checks
Tests (1/3)
• Unit tests with JUnit5 & Mockito
• XWiki is Component-based and we have some JUnit5 Extensions to
make it easy to test/mock dependent components
@ComponentTest
public class DefaultVelocityConfigurationTest
{
@InjectMockComponents
private DefaultVelocityConfiguration configuration;
@Test
public void getToolsReturnsDefaultTools()
{
assertEquals(ListTool.class.getName(), this.configuration.getTools().get("listtool"));
}
}
Tests (2/3)
• Functional tests with Selenium/WebDriver
• Using a PageObjects strategy
Tests (3/3)
• Configuration tests, based on Docker
• Based on TestContainers
• Supported Browsers, Servlet Engines & Databases
• Usable on dev machine, in the IDE!
• Various other more exotic configurations: LibreOffice
server, Clustering, External SOLR server
• Supports Docker Out Of Docker (DOOD)
@UITest(database = Database.MYSQL, databaseTag = "5", servletEngine = ServletEngine.TOMCAT,
servletEngineTag = “8", browser = Browser.CHROME)
public class MenuIT
...
Backward Compatibility Strategy
• Check in the build with Revapi
• When wanted failure, add to
ignore list in pom.xml
• @Deprecated then move to
Legacy module using AspectJ
• Use @Unstable + @Since for
young APIs
• Custom checkstyle check in build to prevent @Unstable from staying more
than 1 cycle
• {{backwardCompatibility}} xwiki macro in release notes
Source: http://dev.xwiki.org/xwiki/bin/view/Community/DevelopmentPractices#HBackwardCompatibility
Code Quality Checks
• Checkstyle with custom rules. For example
• Verify that Script Services are not located in the internal package
• Verify that @since javadoc tags have the correct format
• Verify that @Unstable annotation don't stay too long
• Verify that components.txt contains all Components
• Verify that JUnit tests don't output content to stdout or stderr. 
• Verify header licenses
• And more…
Best Practices Checks
• Spoon checks
• Verify none of the listed methods are called in our Java code
• File#deleteOnExit() - Causes memory leaks since not
guaranteed to be called. Not good with server software.
• URL#equals() -Very slow, access the host with HTTP calls
• Verify that we don't use Commons Lang < 3 (i.e. that commons-
lang:commons-lang artifact is forbidden)
• Verify we don't use Commons Logging or Log4j (since we use SLF4J)
• And a lot more…
Test Coverage Checks - Local
• Using Jacoco and Clover
• Strategy - “Ratchet effect”:
• Each Maven module has a threshold
• Jacoco Maven plugin fails if new code has less
coverage than before in %
• Dev is allowed to increase threshold
• Global Coverage addressed in CI (see later)
Test Quality Checks
• Using PIT/Descartes Maven plugin
• Concepts of PIT
• Modify code under test (mutants) and run tests
• Good tests kill mutants
• Generates a mutation score similar to the coverage %
• Descartes = extreme mutations that execute fast and have high values
Mutation - Example
result =
   (getId() == macroId.getId() || (getId() != null && getId().equals(macroId.getId())))
   && (getSyntax() == macroId.getSyntax() || (getSyntax() != null && getSyntax().equals(
    macroId.getSyntax())));
Mutation Example
@Test
public void testEquality()
{
    MacroId id1 = new MacroId("id", Syntax.XWIKI_2_0);
    MacroId id2 = new MacroId("id", Syntax.XWIKI_2_0);
    MacroId id3 = new MacroId("otherid", Syntax.XWIKI_2_0);
    MacroId id4 = new MacroId("id", Syntax.XHTML_1_0);
    MacroId id5 = new MacroId("otherid", Syntax.XHTML_1_0);
    MacroId id6 = new MacroId("id");
    MacroId id7 = new MacroId("id");
    Assert.assertEquals(id2, id1);
   // Equal objects must have equal hashcode
   Assert.assertTrue(id1.hashCode() == id2.hashCode());
    Assert.assertFalse(id3 == id1);
    Assert.assertFalse(id4 == id1);
    Assert.assertFalse(id5 == id3);
    Assert.assertFalse(id6 == id1);
    Assert.assertEquals(id7, id6);
   // Equal objects must have equal hashcode
   Assert.assertTrue(id6.hashCode() == id7.hashCode());
}
Not testing
for inequality!
Improved thanks to Descartes!
Mutation Limitations
• Takes time to find interesting things to look at and decide if
that’s an issue to handle or not. Need better categorisation in
report (now reported by Descartes):
• Strong pseudo-tested methods:The worst! No matter what the return
values are the tests always fail
• Pseudo-tested methods: Grey area.The tests pass with at least one
modified value.
• Multi module support - PITmp
• But slow on large projects (e.g. 7+ hours just for xwiki-rendering)
Test Quality Checks - Strategy
• Fail the build when the mutation score of a given module is below a
defined threshold in the pom.xml
• The idea is that new tests should, in average, be of quality equal or better
General goal with coverage + mutation: maintain qualitythan past tests.
• Other idea: hook on CI to run it only on modified code/tests.
• Still some hiccups regarding the mutation score stability!
General goal with coverage + mutation: maintain quality
Agenda
• Part 0: XWiki
• The project
• Part 1:The XWiki Build
• Automated quality checks
• Different types of tests
• Part 2: The CI (Jenkins)
• The various XWiki pipelines
• Part 3: Release Process
• Putting it all together
• Future
XWiki’s CI - Jenkins
• XWiki Jobs are Pipeline jobs
• Using “GitHub Organization” type of jobs
• Autodiscovering of all Jenkinsfile in a GitHub organization
• Automatic handling of branches (job creation/deletion)
• Shared Pipeline library for all jobs
• Clover Pipeline job to compute global TPC
• Docker Pipeline jobs for running Docker-based tests on all
configurations
• Moving to Docker agent and DOOD (Docker Out of Docker)
Shared Pipeline Library
• Features
• Maven build
• Check for flickers both environment flickers and test flickers and don’t
send false positives emails in this case. Examples of environment
flickers:
• JVM crash
• GitHub connection issue
• X Display not ready for UI tests
• Uses JIRA to log test flickers
• Display screenshot of failing test in job report
Standard Pipeline Jobs
• 1 job = several builds (13+ in our case)
• Validates different things:
• “Main”: compile and test execution including functional tests
• “Quality”: Revapi checks, checkstyle, Descartes, Jacoco
• “TestRelease”: Simulate a release.Verifies Maven Central
requirements (javadoc, etc)
• “Flavor*”:Various types of functional tests
• Parallel execution for some jobs
Clover Pipeline
• Issue: Local coverage can increase
and global decrease
• Removed code with high TPC
• Code tested indirectly by
functional tests and code
refactoring led to different paths
used
• New module with lower TPC
than average
• Strategy: Fail the CI build if Global
TPC decreases for the current
version
Docker Pipeline Jobs
• Currently a separate pipeline from the main one
• Two issues
• Requires Jenkins Docker agent to be used (Docker
doesn’t work inside vServer that we use). Migration in
progress.
• Long to execute since it tests all configurations and thus
should only be executed once per day.
• Finds all Docker test modules and run Maven on
each of them, passing the configuration as system
properties.
DOOD
• Jenkins agent running as a Docker container
• Pipeline (and thus Maven) executing inside Docker
• Thus Functional tests based on Docker executing inside Docker
• To make it work:
• Mount Docker socket (only Docker client inside Docker)
• Don’t mount volumes: copy data (in and out)
• Requires special care when writing the JUnit5 Test Container
extension
Jenkins Docker Cloud Configuration
• 3 volumes:
• Docker socket
• Maven settings.xml since it
contains passwords
• SSH keys (private data)
Copying with TestContainers
Agenda
• Part 0: XWiki
• The project
• Part 1:The XWiki Build
• Automated quality checks
• Different types of tests
• Part 2:The CI (Jenkins)
• The various XWiki pipelines
• Part 3: Release Process
• Putting it all together
• Future
Release Process
• Ongoing Release Notes and
reference documentation
• Marked in JIRA with 2 custom
fields
• Rolling Release Managers
Source: http://dev.xwiki.org/xwiki/bin/view/ReleasePlans/
• Create Release Plan for the release
Release Plans (1/2)
Source: http://dev.xwiki.org/xwiki/bin/view/ReleasePlans/
Release Plans (2/2)
• Release in JIRA
• Check that all issues are
documented
• Check Release Notes
• Import translations
• Build the Release
• Create mail
announcement
• Push to Maven Central
• Update Docker official
image
• etc
Source: http://dev.xwiki.org/xwiki/bin/view/ReleasePlans/ReleasePlan845
Agenda
• Part 0: XWiki
• The project
• Part 1:The XWiki Build
• Automated quality checks
• Different types of tests
• Part 2:The CI (Jenkins)
• The various XWiki pipelines
• Part 3: Release Process
• Putting it all together
• Future
Future - Build Level
• Move Test configurations to the build
• Fix UI flickerings which are a plague
• Idea: Change our DSL so that all calls always wait on something
Future - CI Level
• Docker pipeline integrated into main Pipeline library
• To handle branches (a pain right now)
• Needs Parametrized Scheduler Plugin
• Move to CD, i.e. implement the release steps in the CI
• Need to resolve Maven versions and put on staging & promote when
we want
• Auto deploy on myxwiki.org
• STAMP: DSpot on diffs, Evocrash (JIRA -> CI)
Q&A
Me

More Related Content

What's hot

(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine
(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine
(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS EngineZongXian Shen
 
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Christian Schneider
 
Maven TestNg frame work (1) (1)
Maven TestNg frame work (1) (1)Maven TestNg frame work (1) (1)
Maven TestNg frame work (1) (1)Gopi Raghavendra
 
Testing basics for developers
Testing basics for developersTesting basics for developers
Testing basics for developersAnton Udovychenko
 
基於 Flow & Path 的 MVP 架構
基於 Flow & Path 的 MVP 架構基於 Flow & Path 的 MVP 架構
基於 Flow & Path 的 MVP 架構玄武 Wu
 
Quickly Testing Legacy C++ Code with Approval Tests
Quickly Testing Legacy C++ Code with Approval TestsQuickly Testing Legacy C++ Code with Approval Tests
Quickly Testing Legacy C++ Code with Approval TestsClare Macrae
 
First adoption hackathon at BGJUG
First adoption hackathon at BGJUGFirst adoption hackathon at BGJUG
First adoption hackathon at BGJUGIvan Ivanov
 
Quickly and Effectively Testing Legacy C++ Code with Approval Tests
Quickly and Effectively Testing Legacy C++ Code with Approval TestsQuickly and Effectively Testing Legacy C++ Code with Approval Tests
Quickly and Effectively Testing Legacy C++ Code with Approval TestsClare Macrae
 
Finding Needles in Haystacks
Finding Needles in HaystacksFinding Needles in Haystacks
Finding Needles in Haystackssnyff
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With SeleniumMarakana Inc.
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Christian Schneider
 
A Taste of Pharo 7.0
A Taste of Pharo 7.0A Taste of Pharo 7.0
A Taste of Pharo 7.0ESUG
 
Introduction to Eclipse Microprofile
Introduction to Eclipse MicroprofileIntroduction to Eclipse Microprofile
Introduction to Eclipse MicroprofileRed Hat Developers
 
Ln monitoring repositories
Ln monitoring repositoriesLn monitoring repositories
Ln monitoring repositoriessnyff
 
Jwt == insecurity?
Jwt == insecurity?Jwt == insecurity?
Jwt == insecurity?snyff
 
Deserialization vulnerabilities
Deserialization vulnerabilitiesDeserialization vulnerabilities
Deserialization vulnerabilitiesGreenD0g
 
Testing JSF with Arquillian and Selenium
Testing JSF with Arquillian and SeleniumTesting JSF with Arquillian and Selenium
Testing JSF with Arquillian and SeleniumLukáš Fryč
 
Real Java EE Testing with Arquillian and ShrinkWrap
Real Java EE Testing with Arquillian and ShrinkWrapReal Java EE Testing with Arquillian and ShrinkWrap
Real Java EE Testing with Arquillian and ShrinkWrapDan Allen
 
Arquillian - Integration Testing Made Easy
Arquillian - Integration Testing Made EasyArquillian - Integration Testing Made Easy
Arquillian - Integration Testing Made EasyJBUG London
 

What's hot (20)

(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine
(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine
(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine
 
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
 
Maven TestNg frame work (1) (1)
Maven TestNg frame work (1) (1)Maven TestNg frame work (1) (1)
Maven TestNg frame work (1) (1)
 
Testing basics for developers
Testing basics for developersTesting basics for developers
Testing basics for developers
 
基於 Flow & Path 的 MVP 架構
基於 Flow & Path 的 MVP 架構基於 Flow & Path 的 MVP 架構
基於 Flow & Path 的 MVP 架構
 
Quickly Testing Legacy C++ Code with Approval Tests
Quickly Testing Legacy C++ Code with Approval TestsQuickly Testing Legacy C++ Code with Approval Tests
Quickly Testing Legacy C++ Code with Approval Tests
 
First adoption hackathon at BGJUG
First adoption hackathon at BGJUGFirst adoption hackathon at BGJUG
First adoption hackathon at BGJUG
 
Quickly and Effectively Testing Legacy C++ Code with Approval Tests
Quickly and Effectively Testing Legacy C++ Code with Approval TestsQuickly and Effectively Testing Legacy C++ Code with Approval Tests
Quickly and Effectively Testing Legacy C++ Code with Approval Tests
 
Finding Needles in Haystacks
Finding Needles in HaystacksFinding Needles in Haystacks
Finding Needles in Haystacks
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
 
A Taste of Pharo 7.0
A Taste of Pharo 7.0A Taste of Pharo 7.0
A Taste of Pharo 7.0
 
Introduction to Eclipse Microprofile
Introduction to Eclipse MicroprofileIntroduction to Eclipse Microprofile
Introduction to Eclipse Microprofile
 
Bug zillatestopiajenkins
Bug zillatestopiajenkinsBug zillatestopiajenkins
Bug zillatestopiajenkins
 
Ln monitoring repositories
Ln monitoring repositoriesLn monitoring repositories
Ln monitoring repositories
 
Jwt == insecurity?
Jwt == insecurity?Jwt == insecurity?
Jwt == insecurity?
 
Deserialization vulnerabilities
Deserialization vulnerabilitiesDeserialization vulnerabilities
Deserialization vulnerabilities
 
Testing JSF with Arquillian and Selenium
Testing JSF with Arquillian and SeleniumTesting JSF with Arquillian and Selenium
Testing JSF with Arquillian and Selenium
 
Real Java EE Testing with Arquillian and ShrinkWrap
Real Java EE Testing with Arquillian and ShrinkWrapReal Java EE Testing with Arquillian and ShrinkWrap
Real Java EE Testing with Arquillian and ShrinkWrap
 
Arquillian - Integration Testing Made Easy
Arquillian - Integration Testing Made EasyArquillian - Integration Testing Made Easy
Arquillian - Integration Testing Made Easy
 

Similar to BUILDING XWIKI

New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projectsVincent Massol
 
Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019Vincent Massol
 
New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projectsVincent Massol
 
Building Top-Notch Androids SDKs
Building Top-Notch Androids SDKsBuilding Top-Notch Androids SDKs
Building Top-Notch Androids SDKsrelayr
 
XWiki SAS development practices
XWiki SAS development practicesXWiki SAS development practices
XWiki SAS development practicesVincent Massol
 
Qt test framework
Qt test frameworkQt test framework
Qt test frameworkICS
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchMats Bryntse
 
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!Ortus Solutions, Corp
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkinsAbe Diaz
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache UsergridDavid M. Johnson
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using JenkinsRogue Wave Software
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScriptRob Scaduto
 
Implementing Quality on a Java Project
Implementing Quality on a Java ProjectImplementing Quality on a Java Project
Implementing Quality on a Java ProjectVincent Massol
 
MyHeritage - QA Automations in a Continuous Deployment environment
MyHeritage -  QA Automations in a Continuous Deployment environmentMyHeritage -  QA Automations in a Continuous Deployment environment
MyHeritage - QA Automations in a Continuous Deployment environmentMatanGoren
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 
Unit Testing and Tools
Unit Testing and ToolsUnit Testing and Tools
Unit Testing and ToolsWilliam Simms
 

Similar to BUILDING XWIKI (20)

New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projects
 
Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019
 
Developing XWiki
Developing XWikiDeveloping XWiki
Developing XWiki
 
New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projects
 
Building Top-Notch Androids SDKs
Building Top-Notch Androids SDKsBuilding Top-Notch Androids SDKs
Building Top-Notch Androids SDKs
 
XWiki SAS development practices
XWiki SAS development practicesXWiki SAS development practices
XWiki SAS development practices
 
Qt test framework
Qt test frameworkQt test framework
Qt test framework
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
 
33rd degree
33rd degree33rd degree
33rd degree
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
 
Implementing Quality on a Java Project
Implementing Quality on a Java ProjectImplementing Quality on a Java Project
Implementing Quality on a Java Project
 
MyHeritage - QA Automations in a Continuous Deployment environment
MyHeritage -  QA Automations in a Continuous Deployment environmentMyHeritage -  QA Automations in a Continuous Deployment environment
MyHeritage - QA Automations in a Continuous Deployment environment
 
Test box bdd
Test box bddTest box bdd
Test box bdd
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Unit Testing and Tools
Unit Testing and ToolsUnit Testing and Tools
Unit Testing and Tools
 

More from Vincent Massol

XWiki Testing with TestContainers
XWiki Testing with TestContainersXWiki Testing with TestContainers
XWiki Testing with TestContainersVincent Massol
 
XWiki: The best wiki for developers
XWiki: The best wiki for developersXWiki: The best wiki for developers
XWiki: The best wiki for developersVincent Massol
 
Configuration Testing with Docker & TestContainers
Configuration Testing with Docker & TestContainersConfiguration Testing with Docker & TestContainers
Configuration Testing with Docker & TestContainersVincent Massol
 
What's new in XWiki 9.x and 10.x
What's new in XWiki 9.x and 10.xWhat's new in XWiki 9.x and 10.x
What's new in XWiki 9.x and 10.xVincent Massol
 
Creating your own project's Quality Dashboard
Creating your own project's Quality DashboardCreating your own project's Quality Dashboard
Creating your own project's Quality DashboardVincent Massol
 
XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and SharepointXWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and SharepointVincent Massol
 
Creating your own project's Quality Dashboard
Creating your own project's Quality DashboardCreating your own project's Quality Dashboard
Creating your own project's Quality DashboardVincent Massol
 
XWiki: The web's Swiss Army Knife
XWiki: The web's Swiss Army KnifeXWiki: The web's Swiss Army Knife
XWiki: The web's Swiss Army KnifeVincent Massol
 
Leading a Community-Driven Open Source Project
Leading a Community-Driven Open Source ProjectLeading a Community-Driven Open Source Project
Leading a Community-Driven Open Source ProjectVincent Massol
 
XWiki Status - July 2015
XWiki Status - July 2015XWiki Status - July 2015
XWiki Status - July 2015Vincent Massol
 
XWiki SAS: An open source company
XWiki SAS: An open source companyXWiki SAS: An open source company
XWiki SAS: An open source companyVincent Massol
 
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014XWiki: A web dev runtime for writing web apps @ FOSDEM 2014
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014Vincent Massol
 
XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014Vincent Massol
 
Implementing Quality on Java projects (Short version)
Implementing Quality on Java projects (Short version)Implementing Quality on Java projects (Short version)
Implementing Quality on Java projects (Short version)Vincent Massol
 
Implementing Quality on Java projects
Implementing Quality on Java projectsImplementing Quality on Java projects
Implementing Quality on Java projectsVincent Massol
 
Combining open source ethics with private interests
Combining open source ethics with private interestsCombining open source ethics with private interests
Combining open source ethics with private interestsVincent Massol
 
Evolutions XWiki 2012/2013
Evolutions XWiki 2012/2013Evolutions XWiki 2012/2013
Evolutions XWiki 2012/2013Vincent Massol
 

More from Vincent Massol (20)

XWiki Testing with TestContainers
XWiki Testing with TestContainersXWiki Testing with TestContainers
XWiki Testing with TestContainers
 
XWiki: The best wiki for developers
XWiki: The best wiki for developersXWiki: The best wiki for developers
XWiki: The best wiki for developers
 
Configuration Testing with Docker & TestContainers
Configuration Testing with Docker & TestContainersConfiguration Testing with Docker & TestContainers
Configuration Testing with Docker & TestContainers
 
What's new in XWiki 9.x and 10.x
What's new in XWiki 9.x and 10.xWhat's new in XWiki 9.x and 10.x
What's new in XWiki 9.x and 10.x
 
QDashboard 1.2
QDashboard 1.2QDashboard 1.2
QDashboard 1.2
 
Advanced Java Testing
Advanced Java TestingAdvanced Java Testing
Advanced Java Testing
 
Creating your own project's Quality Dashboard
Creating your own project's Quality DashboardCreating your own project's Quality Dashboard
Creating your own project's Quality Dashboard
 
XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and SharepointXWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
 
Creating your own project's Quality Dashboard
Creating your own project's Quality DashboardCreating your own project's Quality Dashboard
Creating your own project's Quality Dashboard
 
XWiki: The web's Swiss Army Knife
XWiki: The web's Swiss Army KnifeXWiki: The web's Swiss Army Knife
XWiki: The web's Swiss Army Knife
 
Leading a Community-Driven Open Source Project
Leading a Community-Driven Open Source ProjectLeading a Community-Driven Open Source Project
Leading a Community-Driven Open Source Project
 
XWiki Status - July 2015
XWiki Status - July 2015XWiki Status - July 2015
XWiki Status - July 2015
 
XWiki SAS: An open source company
XWiki SAS: An open source companyXWiki SAS: An open source company
XWiki SAS: An open source company
 
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014XWiki: A web dev runtime for writing web apps @ FOSDEM 2014
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014
 
XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014
 
Implementing Quality on Java projects (Short version)
Implementing Quality on Java projects (Short version)Implementing Quality on Java projects (Short version)
Implementing Quality on Java projects (Short version)
 
Implementing Quality on Java projects
Implementing Quality on Java projectsImplementing Quality on Java projects
Implementing Quality on Java projects
 
Combining open source ethics with private interests
Combining open source ethics with private interestsCombining open source ethics with private interests
Combining open source ethics with private interests
 
Evolutions XWiki 2012/2013
Evolutions XWiki 2012/2013Evolutions XWiki 2012/2013
Evolutions XWiki 2012/2013
 
Developing XWiki
Developing XWikiDeveloping XWiki
Developing XWiki
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

BUILDING XWIKI

  • 1. 27 au 29 mars 2013Vincent Massol,April 2019 Building XWiki
  • 2. Vincent Massol • CTO XWiki SAS • Open source developer • My Projects • XWiki (community-driven open source project) • Past: Maven,Apache Cargo,Apache Cactus, Pattern Testing • Other Credentials: • LesCastCodeurs podcast about Java news • Creator of OSSGTP open source group in Paris • 3 books: JUnit in Action, Maven:A Developer’s Notebook, BBWM
  • 3. Agenda • Part 0: XWiki • The project • Part 1:The XWiki Build • Automated quality checks • Different types of tests • Part 2:The CI (Jenkins) • The various XWiki pipelines • Part 3: Release Process • Putting it all together • Future
  • 4. Agenda • Part 0: XWiki • The project • Part 1:The XWiki Build • Automated quality checks • Different types of tests • Part 2:The CI (Jenkins) • The various XWiki pipelines • Part 3: Release Process • Putting it all together • Future
  • 5. What is XWiki? (1/2) • A structured open source enterprise wiki
  • 6. What is XWiki? (2/2) • A platform for developing content-based web applications
  • 8. Motivation • Change the world! • Needs impact • Needs max number of users • Open source • Needs to show progress • Release often • Needs developers / contributors • Community-driven • Requires Time-boxing • XWiki releases every month (3 weeks for RC1, 1w for final) • Requires integration between all parts • Requires CI tool • Requires quality-control • Requires automated Tests • Requires releases as automated as possible • Requires automated Build • Requires good communication
  • 10. Governance • Complete separation from XWiki SAS and XWiki.org • Only individuals working on the open source project • Rules similar to the ASF • Committership, voting (0, +1, -1), lazy consensus • xwiki.org governance and company advertising: sponsoring companies Source: http://dev.xwiki.org/xwiki/bin/view/Community/Governance
  • 11. Agenda • Part 0: XWiki • The project • Part 1: The XWiki Build • Automated quality checks • Different types of tests • Part 2:The CI (Jenkins) • The various XWiki pipelines • Part 3: Release Process • Putting it all together • Future
  • 12. Build • Maven-based with several custom plugins • Active Quality vs Passive Quality. • Strategy: if it’s not in the build it doesn’t exist! • Common to everyone • If something is important it must fail the build, otherwise it’s not important • Try to reduce CI code to the maximum for local reproducibility and to be less tied to the CI Source: http://dev.xwiki.org/xwiki/bin/view/Community/Building Build = implement quality
  • 13. Automated Checks • Standard ones: compilation, tests, javadoc linter, etc • Test execution: unit, functional, configuration,WCAG, HTML validation • Backward compatibility checks • Code quality checks • Best practices checks • Test coverage checks • Test quality checks
  • 14. Tests (1/3) • Unit tests with JUnit5 & Mockito • XWiki is Component-based and we have some JUnit5 Extensions to make it easy to test/mock dependent components @ComponentTest public class DefaultVelocityConfigurationTest { @InjectMockComponents private DefaultVelocityConfiguration configuration; @Test public void getToolsReturnsDefaultTools() { assertEquals(ListTool.class.getName(), this.configuration.getTools().get("listtool")); } }
  • 15. Tests (2/3) • Functional tests with Selenium/WebDriver • Using a PageObjects strategy
  • 16. Tests (3/3) • Configuration tests, based on Docker • Based on TestContainers • Supported Browsers, Servlet Engines & Databases • Usable on dev machine, in the IDE! • Various other more exotic configurations: LibreOffice server, Clustering, External SOLR server • Supports Docker Out Of Docker (DOOD) @UITest(database = Database.MYSQL, databaseTag = "5", servletEngine = ServletEngine.TOMCAT, servletEngineTag = “8", browser = Browser.CHROME) public class MenuIT ...
  • 17. Backward Compatibility Strategy • Check in the build with Revapi • When wanted failure, add to ignore list in pom.xml • @Deprecated then move to Legacy module using AspectJ • Use @Unstable + @Since for young APIs • Custom checkstyle check in build to prevent @Unstable from staying more than 1 cycle • {{backwardCompatibility}} xwiki macro in release notes Source: http://dev.xwiki.org/xwiki/bin/view/Community/DevelopmentPractices#HBackwardCompatibility
  • 18. Code Quality Checks • Checkstyle with custom rules. For example • Verify that Script Services are not located in the internal package • Verify that @since javadoc tags have the correct format • Verify that @Unstable annotation don't stay too long • Verify that components.txt contains all Components • Verify that JUnit tests don't output content to stdout or stderr.  • Verify header licenses • And more…
  • 19. Best Practices Checks • Spoon checks • Verify none of the listed methods are called in our Java code • File#deleteOnExit() - Causes memory leaks since not guaranteed to be called. Not good with server software. • URL#equals() -Very slow, access the host with HTTP calls • Verify that we don't use Commons Lang < 3 (i.e. that commons- lang:commons-lang artifact is forbidden) • Verify we don't use Commons Logging or Log4j (since we use SLF4J) • And a lot more…
  • 20. Test Coverage Checks - Local • Using Jacoco and Clover • Strategy - “Ratchet effect”: • Each Maven module has a threshold • Jacoco Maven plugin fails if new code has less coverage than before in % • Dev is allowed to increase threshold • Global Coverage addressed in CI (see later)
  • 21. Test Quality Checks • Using PIT/Descartes Maven plugin • Concepts of PIT • Modify code under test (mutants) and run tests • Good tests kill mutants • Generates a mutation score similar to the coverage % • Descartes = extreme mutations that execute fast and have high values
  • 22. Mutation - Example result =    (getId() == macroId.getId() || (getId() != null && getId().equals(macroId.getId())))    && (getSyntax() == macroId.getSyntax() || (getSyntax() != null && getSyntax().equals(     macroId.getSyntax())));
  • 23. Mutation Example @Test public void testEquality() {     MacroId id1 = new MacroId("id", Syntax.XWIKI_2_0);     MacroId id2 = new MacroId("id", Syntax.XWIKI_2_0);     MacroId id3 = new MacroId("otherid", Syntax.XWIKI_2_0);     MacroId id4 = new MacroId("id", Syntax.XHTML_1_0);     MacroId id5 = new MacroId("otherid", Syntax.XHTML_1_0);     MacroId id6 = new MacroId("id");     MacroId id7 = new MacroId("id");     Assert.assertEquals(id2, id1);    // Equal objects must have equal hashcode    Assert.assertTrue(id1.hashCode() == id2.hashCode());     Assert.assertFalse(id3 == id1);     Assert.assertFalse(id4 == id1);     Assert.assertFalse(id5 == id3);     Assert.assertFalse(id6 == id1);     Assert.assertEquals(id7, id6);    // Equal objects must have equal hashcode    Assert.assertTrue(id6.hashCode() == id7.hashCode()); } Not testing for inequality! Improved thanks to Descartes!
  • 24. Mutation Limitations • Takes time to find interesting things to look at and decide if that’s an issue to handle or not. Need better categorisation in report (now reported by Descartes): • Strong pseudo-tested methods:The worst! No matter what the return values are the tests always fail • Pseudo-tested methods: Grey area.The tests pass with at least one modified value. • Multi module support - PITmp • But slow on large projects (e.g. 7+ hours just for xwiki-rendering)
  • 25. Test Quality Checks - Strategy • Fail the build when the mutation score of a given module is below a defined threshold in the pom.xml • The idea is that new tests should, in average, be of quality equal or better General goal with coverage + mutation: maintain qualitythan past tests. • Other idea: hook on CI to run it only on modified code/tests. • Still some hiccups regarding the mutation score stability! General goal with coverage + mutation: maintain quality
  • 26. Agenda • Part 0: XWiki • The project • Part 1:The XWiki Build • Automated quality checks • Different types of tests • Part 2: The CI (Jenkins) • The various XWiki pipelines • Part 3: Release Process • Putting it all together • Future
  • 27. XWiki’s CI - Jenkins • XWiki Jobs are Pipeline jobs • Using “GitHub Organization” type of jobs • Autodiscovering of all Jenkinsfile in a GitHub organization • Automatic handling of branches (job creation/deletion) • Shared Pipeline library for all jobs • Clover Pipeline job to compute global TPC • Docker Pipeline jobs for running Docker-based tests on all configurations • Moving to Docker agent and DOOD (Docker Out of Docker)
  • 28. Shared Pipeline Library • Features • Maven build • Check for flickers both environment flickers and test flickers and don’t send false positives emails in this case. Examples of environment flickers: • JVM crash • GitHub connection issue • X Display not ready for UI tests • Uses JIRA to log test flickers • Display screenshot of failing test in job report
  • 29. Standard Pipeline Jobs • 1 job = several builds (13+ in our case) • Validates different things: • “Main”: compile and test execution including functional tests • “Quality”: Revapi checks, checkstyle, Descartes, Jacoco • “TestRelease”: Simulate a release.Verifies Maven Central requirements (javadoc, etc) • “Flavor*”:Various types of functional tests • Parallel execution for some jobs
  • 30. Clover Pipeline • Issue: Local coverage can increase and global decrease • Removed code with high TPC • Code tested indirectly by functional tests and code refactoring led to different paths used • New module with lower TPC than average • Strategy: Fail the CI build if Global TPC decreases for the current version
  • 31. Docker Pipeline Jobs • Currently a separate pipeline from the main one • Two issues • Requires Jenkins Docker agent to be used (Docker doesn’t work inside vServer that we use). Migration in progress. • Long to execute since it tests all configurations and thus should only be executed once per day. • Finds all Docker test modules and run Maven on each of them, passing the configuration as system properties.
  • 32. DOOD • Jenkins agent running as a Docker container • Pipeline (and thus Maven) executing inside Docker • Thus Functional tests based on Docker executing inside Docker • To make it work: • Mount Docker socket (only Docker client inside Docker) • Don’t mount volumes: copy data (in and out) • Requires special care when writing the JUnit5 Test Container extension
  • 33. Jenkins Docker Cloud Configuration • 3 volumes: • Docker socket • Maven settings.xml since it contains passwords • SSH keys (private data)
  • 35. Agenda • Part 0: XWiki • The project • Part 1:The XWiki Build • Automated quality checks • Different types of tests • Part 2:The CI (Jenkins) • The various XWiki pipelines • Part 3: Release Process • Putting it all together • Future
  • 36. Release Process • Ongoing Release Notes and reference documentation • Marked in JIRA with 2 custom fields • Rolling Release Managers Source: http://dev.xwiki.org/xwiki/bin/view/ReleasePlans/ • Create Release Plan for the release
  • 37. Release Plans (1/2) Source: http://dev.xwiki.org/xwiki/bin/view/ReleasePlans/
  • 38. Release Plans (2/2) • Release in JIRA • Check that all issues are documented • Check Release Notes • Import translations • Build the Release • Create mail announcement • Push to Maven Central • Update Docker official image • etc Source: http://dev.xwiki.org/xwiki/bin/view/ReleasePlans/ReleasePlan845
  • 39. Agenda • Part 0: XWiki • The project • Part 1:The XWiki Build • Automated quality checks • Different types of tests • Part 2:The CI (Jenkins) • The various XWiki pipelines • Part 3: Release Process • Putting it all together • Future
  • 40. Future - Build Level • Move Test configurations to the build • Fix UI flickerings which are a plague • Idea: Change our DSL so that all calls always wait on something
  • 41. Future - CI Level • Docker pipeline integrated into main Pipeline library • To handle branches (a pain right now) • Needs Parametrized Scheduler Plugin • Move to CD, i.e. implement the release steps in the CI • Need to resolve Maven versions and put on staging & promote when we want • Auto deploy on myxwiki.org • STAMP: DSpot on diffs, Evocrash (JIRA -> CI)