SlideShare a Scribd company logo
1 of 16
Download to read offline
XWiki Testing with
TestContainers
Vincent Massol,April 2022
Agenda
• Context: the XWiki use case
• The TestContainer approach
• Return of experience
• Conclusion
What is XWiki?
• Open source wiki
• 16 years
• 10-15 active committers
• Very extensible, scripting in wiki pages
• Platform for developing ad-hoc web applications
• Strong build practices using Maven and lots of “Quality” plugins
• Using Jenkins & custom pipeline library for the CI
https://xwiki.org
Use Case: XWiki
• Application with functional tests, e.g. web
app & UI tests
Servlet Engine
Webapp
(XWiki)
Browser
JDBC
HTTP
DB Type DB Version JDBC Driver Servlet E.Type
Servlet E.
Version
Browser Type Browser Version Other
5.7.24 5.1.45 8.5.35 63.0 N/A
9.6.8 42.1.4 Latest 9.x 70.0.3538.77 Solr External
2.4.1 2.4.1 9.4.12 60.0.2 Clustering
Latest 10.3.x Latest 9.4.8.v20171121 67.0.3396.87
LibreOf
fi
ce
Server
Problem: Con
fi
gurations
• Validate that XWiki works on supported
con
fi
gurations
Docker
Container #3
Docker Container #2
Docker
Container #1
Solution: Dockerization
• Use Docker to represent the various
con
fi
gurations
Servlet Engine
Webapp
(XWiki)
Browser
TestContainers
@Testcontainers

public class MyTestcontainersTests {
@Container

private static final MySQLContainer MY_SQL_CONTAINER = new
MySQLContainer();
@Container

private PostgreSQLContainer pgsqlContainer = new PostgreSQLContainer()

.withDatabaseName("foo")

.withUsername("foo")

.withPassword("secret");
• Reproduce and debug locally and in IDE
testcontainers.org
TestContainers Features
• Several built-in Containers: MySQL, PostgreSQL,
Selenium/WebDriver, ElasticSearch, Nginx, and a lot
more… even a DockerCompose one!
• Automatically record videos
• Automatic and powerful clean up of containers
• Full Docker API available (uses docker-java
underneath)
• Create Docker images on the
fl
y
XWiki & TestContainers
@UITest(

database = Database.MYSQL,

databaseTag = "5",

servletEngine = ServletEngine.TOMCAT,

servletEngineTag = "8",

browser = Browser.CHROME)
public class MenuIT
• Custom JUnit5 Extension, makes it easy to
use for XWiki devs
Selenium test here
Demo Time
The Good
• Easy to use/debug a given
con
fi
guration and in your IDE
• Including production problems
• Works on all OS
• … with some work (e.g. Mac M1)
• It
fi
nds problems!
• Hard to know how many since
most don’t end up in JIRA…
The Bad (1/2)
• Requires maintenance
• Docker image tags to update
• Changes to support all architectures (e.g. Mac M1
with ARM support)
• Regular cryptic failures/false positives not due to
tests
• Hard to know if the problem is Jenkins (CI),
Network and XWiki infra, or TC
The Bad (2/2)
• Slow tests (between 6 to 14 hours for
950+ tests)
• Docker tests running in parallel on
the CI
• Increasing
fl
ickering UI tests…
• 90 as of now
• Not all related to con
fi
guration
testing
Conclusion
• TestContainers is very nice and easy to use
• Worth it if
fi
nding an environment-related problem is
critical and more important than the cost of
maintenance required
• Ideally, you need a full person dedicated to the build (at
least for the level of XWiki)
• High cost when building the initial framework
• Don’t write only UI tests, make sure to move the max #
of tests as unit tests or integration tests (especially for
edge conditions)
Q&A
Me
Vincent Massol
vincent@massol.net
http://about.me/vmassol
https://xwiki.org
https://xwiki.com

More Related Content

Similar to XWiki Testing with TestContainers

Similar to XWiki Testing with TestContainers (20)

Efficient Parallel Testing with Docker
Efficient Parallel Testing with DockerEfficient Parallel Testing with Docker
Efficient Parallel Testing with Docker
 
Performance testing with 100,000 concurrent users in AWS
Performance testing with 100,000 concurrent users in AWSPerformance testing with 100,000 concurrent users in AWS
Performance testing with 100,000 concurrent users in AWS
 
Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...
Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...
Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for Realists
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
 
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
 
Docker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud ApplicationsDocker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud Applications
 
Building Efficient Parallel Testing Platforms with Docker
Building Efficient Parallel Testing Platforms with DockerBuilding Efficient Parallel Testing Platforms with Docker
Building Efficient Parallel Testing Platforms with Docker
 
Jenkins Overview
Jenkins OverviewJenkins Overview
Jenkins Overview
 
Efficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura FrankEfficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura Frank
 
MyHeritage - End 2 End testing Infra
MyHeritage - End 2 End testing InfraMyHeritage - End 2 End testing Infra
MyHeritage - End 2 End testing Infra
 
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
 
CD with spinnaker
CD with spinnakerCD with spinnaker
CD with spinnaker
 
Telerik test studio webinar deck
Telerik  test studio webinar deckTelerik  test studio webinar deck
Telerik test studio webinar deck
 
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
 
Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXC
 
Building XWiki
Building XWikiBuilding XWiki
Building XWiki
 
Continuous Delivery Using Jenkins
Continuous Delivery Using JenkinsContinuous Delivery Using Jenkins
Continuous Delivery Using Jenkins
 
No Compromise - Better, Stronger, Faster Java in the Cloud
No Compromise - Better, Stronger, Faster Java in the CloudNo Compromise - Better, Stronger, Faster Java in the Cloud
No Compromise - Better, Stronger, Faster Java in the Cloud
 

More from Vincent 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 Sharepoint
Vincent Massol
 

More from Vincent Massol (20)

XWiki: The best wiki for developers
XWiki: The best wiki for developersXWiki: The best wiki for developers
XWiki: The best wiki for developers
 
Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019
 
Configuration Testing with Docker & TestContainers
Configuration Testing with Docker & TestContainersConfiguration Testing with Docker & TestContainers
Configuration Testing with Docker & TestContainers
 
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
 
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
 
Developing XWiki
Developing XWikiDeveloping XWiki
Developing XWiki
 
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 a Java Project
Implementing Quality on a Java ProjectImplementing Quality on a Java Project
Implementing Quality on a Java Project
 
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 in Java projects
Implementing quality in Java projectsImplementing quality in Java projects
Implementing quality in Java projects
 

Recently uploaded

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

XWiki Testing with TestContainers

  • 2. Agenda • Context: the XWiki use case • The TestContainer approach • Return of experience • Conclusion
  • 3. What is XWiki? • Open source wiki • 16 years • 10-15 active committers • Very extensible, scripting in wiki pages • Platform for developing ad-hoc web applications • Strong build practices using Maven and lots of “Quality” plugins • Using Jenkins & custom pipeline library for the CI https://xwiki.org
  • 4. Use Case: XWiki • Application with functional tests, e.g. web app & UI tests Servlet Engine Webapp (XWiki) Browser JDBC HTTP
  • 5. DB Type DB Version JDBC Driver Servlet E.Type Servlet E. Version Browser Type Browser Version Other 5.7.24 5.1.45 8.5.35 63.0 N/A 9.6.8 42.1.4 Latest 9.x 70.0.3538.77 Solr External 2.4.1 2.4.1 9.4.12 60.0.2 Clustering Latest 10.3.x Latest 9.4.8.v20171121 67.0.3396.87 LibreOf fi ce Server Problem: Con fi gurations • Validate that XWiki works on supported con fi gurations
  • 6. Docker Container #3 Docker Container #2 Docker Container #1 Solution: Dockerization • Use Docker to represent the various con fi gurations Servlet Engine Webapp (XWiki) Browser
  • 7. TestContainers @Testcontainers
 public class MyTestcontainersTests { @Container
 private static final MySQLContainer MY_SQL_CONTAINER = new MySQLContainer(); @Container
 private PostgreSQLContainer pgsqlContainer = new PostgreSQLContainer()
 .withDatabaseName("foo")
 .withUsername("foo")
 .withPassword("secret"); • Reproduce and debug locally and in IDE testcontainers.org
  • 8. TestContainers Features • Several built-in Containers: MySQL, PostgreSQL, Selenium/WebDriver, ElasticSearch, Nginx, and a lot more… even a DockerCompose one! • Automatically record videos • Automatic and powerful clean up of containers • Full Docker API available (uses docker-java underneath) • Create Docker images on the fl y
  • 9. XWiki & TestContainers @UITest(
 database = Database.MYSQL,
 databaseTag = "5",
 servletEngine = ServletEngine.TOMCAT,
 servletEngineTag = "8",
 browser = Browser.CHROME) public class MenuIT • Custom JUnit5 Extension, makes it easy to use for XWiki devs Selenium test here
  • 11. The Good • Easy to use/debug a given con fi guration and in your IDE • Including production problems • Works on all OS • … with some work (e.g. Mac M1) • It fi nds problems! • Hard to know how many since most don’t end up in JIRA…
  • 12. The Bad (1/2) • Requires maintenance • Docker image tags to update • Changes to support all architectures (e.g. Mac M1 with ARM support) • Regular cryptic failures/false positives not due to tests • Hard to know if the problem is Jenkins (CI), Network and XWiki infra, or TC
  • 13. The Bad (2/2) • Slow tests (between 6 to 14 hours for 950+ tests) • Docker tests running in parallel on the CI • Increasing fl ickering UI tests… • 90 as of now • Not all related to con fi guration testing
  • 14. Conclusion • TestContainers is very nice and easy to use • Worth it if fi nding an environment-related problem is critical and more important than the cost of maintenance required • Ideally, you need a full person dedicated to the build (at least for the level of XWiki) • High cost when building the initial framework • Don’t write only UI tests, make sure to move the max # of tests as unit tests or integration tests (especially for edge conditions)