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

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 

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)