SlideShare a Scribd company logo
1 of 20
Download to read offline
Continuous Integration:
Improving Quality in Moodle
Dan Poltawski
Integrator
Moodle HQ
@dan_p
the world’s open source learning platform
#mootieuk15
the world’s open source learning platform
Wide topic, today focusing on:
• “Each integration is verified by an automated build
(including test) to detect integration errors as quickly as
possible.” - Martin Fowler
http://www.martinfowler.com/articles/continuousIntegration.html
Continuous Integration
the world’s open source learning platform
Integration Process: 2001 - 2010
Numerous problems:
• Single developer may be only person aware of a
change
• Inconsistency was rife
• Developers often unaware of the consequences of
some changes
• Testing was not enforced
• Unit tests were limited and frequently broken
New Development
Release
the world’s open source learning platform
Moved to git and brought about a change in
development process
• Enforced code review
• Enforced ‘manual testing’
• Integration team introduced to move
towards ensuring more consistency
• Introduction of CI systems
Integration Process: Today
Automated Tests
Automated Checks
New Development
Peer Review
Integration Review
Testing
Release
the world’s open source learning platform
• Needed automated tests to supplement the
manual reviews done by the Integration
team
• CI Server was setup - Jenkins
• Open source/extensible
• Self hosted
• http://jenkins-ci.org
Post-integration checker
Automated Tests
Automated Checks
New Development
Peer Review
Integration Review
Testing
Release
the world’s open source learning platform
Post-integration checker
Jenkins polls for changes in
integration.gitCode pushed to integration.git
Issue status is set (e.g. failed)
Detects code changes and starts
running checked jobs
Jenkins notifies status changes
Integration team Jenkins
the world’s open source learning platform
Post-Integration Checks
the world’s open source learning platform
Post-integration checks: whitespace
• First job to be created (the whitespace police
started it all!)
• Detect incorrectly spacing added
• Frequent error:
• Easy to miss setting up your editor for
Moodle
• Not spotted easily by reviewers
the world’s open source learning platform
Post-integration checks: compare upgrade & install
• Detects DB inconsistencies
between install and upgrade code:
1. Runs the installer
2. Run upgrade from a previous
version
3. Compares the database
schema from both
4. Fails in the case of any
differences
• Finds schema inconsistencies
previously frequently undetected -
(common source of number of 1.9 -
> 2.x upgrade bugs)
• Also brings fringe benefit of testing
upgrade code (though limited by
lack of data)
the world’s open source learning platform
• Initially support for Moodle 2.0-2.2 with
SimpleTest
• Custom CLI generated test data, ran
tests and output results as JUnit xml file
• Culturally testing was not embedded
• Tests rarely run or added by developers
• Had to mock everything - no way to
setup test data
Post-integration checks: Unit testing
the world’s open source learning platform
• Moodle 2.3 added support for PHPUnit
• Data generators significantly improved unit testing
experience
• Helped move cultural change towards automated tests
• Challenges:
• Keeping the test time down
• ‘Random’ fails
Post-integration checks: Unit testing
Moodle 2.3 Moodle 2.6 Moodle 2.9
24,273 44,491 58,011
the world’s open source learning platform
Unit test assertions
the world’s open source learning platform
• Many created a result of mistakes slipping through:
• Incorrect upgrade savepoints
• version.php file check
• Check files built correctly (less, shifter, grunt)
• php syntax check (php -l)
• Unresolved merge conflicts
Post-integration checks: Others
the world’s open source learning platform
• Desirable to check before integration
• Can help reduce delays
(timezones) by providing more rapid
feedback
• Better suited to more pedantic
checks
• Provide supplemental information
rather than just pass/fail
Pre-integration checker
Automated Tests
Automated Checks
New Development
Peer Review
Integration Review
Testing
Release
Inline
comments must end
in full-stops, exclamation
marks, or question
marks.
the world’s open source learning platform
Pre-integration checker
Merges branch with moodle.git
Run pre check jobs against
merged branch
Produce ‘smurffile’ of changes,
filtered by lines affected by patch
jshint
phpcs
csslint
phpdoc
php -l
commit
savepoint
thirdparty
Report summary back to tracker
checkstyle.xml
the world’s open source learning platform
• Not possible to run all our testing scenarios on a
per-commit basis due to time to run
• Nightly server does these long-running tasks
• Behat (Acceptance tests)
• Multi-platform tests
• phpunit: pgsql, mariadb, mysql, mssql,
oracle
• behat: firefox, chrome, phantomjs
Nightly checks
Automated Tests
Automated Checks
New Development
Peer Review
Integration Review
Testing
Release
the world’s open source learning platform
//Teacher creates a discussion
@Test
public void teacherCreateDiscussion() throws Exception {
//Adding a discussion
forum.clickForumLink(this.properties.get("nameOfForum"));
forum.clickAddNewDiscussionTopicButton();
forumPosts.enterSubjectField(this.properties.get("teacherSubject"));
forumPosts.enterMessage(this.properties.get("teacherMessage"));
forumPosts.clickPostToForum();
}
Automated UI tests: Selenium Native
• Java-based selenium test suite
• Not embedded in development process
• Tests written by test manager, not developers
• Maintained in separate repository
Scenarios in 2.3
28
the world’s open source learning platform
Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Subscription mode | Optional subscription |
And I add a new discussion to "Test forum name" forum with:
| Subject | Test post subject |
| Message | Test post message |
Automated UI tests: Behat
• Improving from pure selenium implementation
• No java :-) Human-friendly ‘Gherkin’ language
• PHP integration code
• Tests required to land with features by developers
• Culturally embedded Scenarios in 2.9
412
the world’s open source learning platform
• Many pre-checker ideas
• Run phpunit/behat/multi-
platform tests in pre-checker
(split by component)
• Intelligent re-checking when
branches get updated
• Backup/restore checks
• Custom jira fields for prechecker
• Automated rejections
• Webservices testing
• Run all post-check’s in pre-checker
• Others as we detect them
Future
Questions?
@dan_p
the world’s open source learning platform
https://github.com/moodlehq/moodle-local_ci

More Related Content

What's hot

Automating testing with open source tools (1)
Automating testing with open source tools (1)Automating testing with open source tools (1)
Automating testing with open source tools (1)Rohit Biradar
 
Run Selenium Tests With Microsoft Test Manager
Run Selenium Tests With Microsoft Test ManagerRun Selenium Tests With Microsoft Test Manager
Run Selenium Tests With Microsoft Test ManagerDaniel Herken
 
PowerShell Plus v4.7 Overview
PowerShell Plus v4.7 OverviewPowerShell Plus v4.7 Overview
PowerShell Plus v4.7 OverviewRichard Giles
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing AutomationAgileEngine
 
Automated Builds And UI Testing in SharePoint 2010 Development
Automated Builds And UI Testing in SharePoint 2010 DevelopmentAutomated Builds And UI Testing in SharePoint 2010 Development
Automated Builds And UI Testing in SharePoint 2010 DevelopmentChris O'Brien
 
MVP 2.0 Final Presentation
MVP 2.0 Final PresentationMVP 2.0 Final Presentation
MVP 2.0 Final Presentationsammy93
 
How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?Dmitry Buzdin
 
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...Trójmiejska Grupa Testerska
 
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing ToolsHDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing ToolsJeff Bramwell
 
Как не нужно писать Gherkin сценарии
Как не нужно писать Gherkin сценарииКак не нужно писать Gherkin сценарии
Как не нужно писать Gherkin сценарииAndrii Dzynia
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Joe Ferguson
 
Mozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10nMozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10nHenrik Skupin
 
Massively maintained accessibility: WordPress
Massively maintained accessibility: WordPressMassively maintained accessibility: WordPress
Massively maintained accessibility: WordPressJoseph Dolson
 
UI Testing Automation - Alex Kalinovsky - CreamTec LLC
UI Testing Automation - Alex Kalinovsky - CreamTec LLCUI Testing Automation - Alex Kalinovsky - CreamTec LLC
UI Testing Automation - Alex Kalinovsky - CreamTec LLCJim Lane
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUlrich Krause
 

What's hot (20)

Automating testing with open source tools (1)
Automating testing with open source tools (1)Automating testing with open source tools (1)
Automating testing with open source tools (1)
 
Run Selenium Tests With Microsoft Test Manager
Run Selenium Tests With Microsoft Test ManagerRun Selenium Tests With Microsoft Test Manager
Run Selenium Tests With Microsoft Test Manager
 
PowerShell Plus v4.7 Overview
PowerShell Plus v4.7 OverviewPowerShell Plus v4.7 Overview
PowerShell Plus v4.7 Overview
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing Automation
 
Automated Builds And UI Testing in SharePoint 2010 Development
Automated Builds And UI Testing in SharePoint 2010 DevelopmentAutomated Builds And UI Testing in SharePoint 2010 Development
Automated Builds And UI Testing in SharePoint 2010 Development
 
MVP 2.0 Final Presentation
MVP 2.0 Final PresentationMVP 2.0 Final Presentation
MVP 2.0 Final Presentation
 
Marcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with seleniumMarcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with selenium
 
How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?
 
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
 
Framework
FrameworkFramework
Framework
 
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing ToolsHDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
 
Codeception
CodeceptionCodeception
Codeception
 
Selenium Frameworks
Selenium FrameworksSelenium Frameworks
Selenium Frameworks
 
Как не нужно писать Gherkin сценарии
Как не нужно писать Gherkin сценарииКак не нужно писать Gherkin сценарии
Как не нужно писать Gherkin сценарии
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
 
Jbehave selenium
Jbehave seleniumJbehave selenium
Jbehave selenium
 
Mozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10nMozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10n
 
Massively maintained accessibility: WordPress
Massively maintained accessibility: WordPressMassively maintained accessibility: WordPress
Massively maintained accessibility: WordPress
 
UI Testing Automation - Alex Kalinovsky - CreamTec LLC
UI Testing Automation - Alex Kalinovsky - CreamTec LLCUI Testing Automation - Alex Kalinovsky - CreamTec LLC
UI Testing Automation - Alex Kalinovsky - CreamTec LLC
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
 

Viewers also liked

Tools and Tips for Moodle Developers - #mootus16
 Tools and Tips for Moodle Developers - #mootus16 Tools and Tips for Moodle Developers - #mootus16
Tools and Tips for Moodle Developers - #mootus16Dan Poltawski
 
Lightweight continuous delivery for small schools
Lightweight continuous delivery for small schoolsLightweight continuous delivery for small schools
Lightweight continuous delivery for small schoolsCharles Fulton
 
Building a Drupal site with Git
Building a Drupal site with GitBuilding a Drupal site with Git
Building a Drupal site with Gitdirtytactics
 
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...Taller Negócio Digitais
 
Scaling Open edX with Kubernetes
Scaling Open edX with KubernetesScaling Open edX with Kubernetes
Scaling Open edX with KubernetesAppsembler
 
Getting started with Jenkins
Getting started with JenkinsGetting started with Jenkins
Getting started with JenkinsEdureka!
 
Jenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous DeliveryJenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous DeliveryVirendra Bhalothia
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Andrew Bayer
 

Viewers also liked (9)

Tools and Tips for Moodle Developers - #mootus16
 Tools and Tips for Moodle Developers - #mootus16 Tools and Tips for Moodle Developers - #mootus16
Tools and Tips for Moodle Developers - #mootus16
 
Lightweight continuous delivery for small schools
Lightweight continuous delivery for small schoolsLightweight continuous delivery for small schools
Lightweight continuous delivery for small schools
 
Building a Drupal site with Git
Building a Drupal site with GitBuilding a Drupal site with Git
Building a Drupal site with Git
 
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
 
Scaling Open edX with Kubernetes
Scaling Open edX with KubernetesScaling Open edX with Kubernetes
Scaling Open edX with Kubernetes
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Getting started with Jenkins
Getting started with JenkinsGetting started with Jenkins
Getting started with Jenkins
 
Jenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous DeliveryJenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous Delivery
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
 

Similar to Continuous Integration: Improving Quality in Moodle

Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using JenkinsRogue Wave Software
 
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...Bruno Tanoue
 
20060712 automated model based testing of community-driven open-source gui ap...
20060712 automated model based testing of community-driven open-source gui ap...20060712 automated model based testing of community-driven open-source gui ap...
20060712 automated model based testing of community-driven open-source gui ap...Will Shen
 
Modern Module Development
Modern Module DevelopmentModern Module Development
Modern Module Development_morgan
 
Hudson
HudsonHudson
Hudson8x8
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperMike Melusky
 
Getting Started with Test-Driven Development at PHPtek 2023
Getting Started with Test-Driven Development at PHPtek 2023Getting Started with Test-Driven Development at PHPtek 2023
Getting Started with Test-Driven Development at PHPtek 2023Scott Keck-Warren
 
Testing Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user groupTesting Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user groupViktor Gamov
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperMike Melusky
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal infoSynapseindiappsdevelopment
 
Automated Testing Environment by Bugzilla, Testopia and Jenkins
Automated Testing Environment by Bugzilla, Testopia and JenkinsAutomated Testing Environment by Bugzilla, Testopia and Jenkins
Automated Testing Environment by Bugzilla, Testopia and Jenkinswalkerchang
 
A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)Thierry Gayet
 
Windows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementWindows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementSharkrit JOBBO
 
Selenium web driver_2.0_presentation
Selenium web driver_2.0_presentationSelenium web driver_2.0_presentation
Selenium web driver_2.0_presentationsayhi2sudarshan
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test AutomationSauce Labs
 
Getting started with Octopus Deploy
Getting started with Octopus DeployGetting started with Octopus Deploy
Getting started with Octopus DeployKaroline Klever
 
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...Postman
 

Similar to Continuous Integration: Improving Quality in Moodle (20)

Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
 
20060712 automated model based testing of community-driven open-source gui ap...
20060712 automated model based testing of community-driven open-source gui ap...20060712 automated model based testing of community-driven open-source gui ap...
20060712 automated model based testing of community-driven open-source gui ap...
 
Modern Module Development
Modern Module DevelopmentModern Module Development
Modern Module Development
 
Hudson
HudsonHudson
Hudson
 
Unit test
Unit testUnit test
Unit test
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Getting Started with Test-Driven Development at PHPtek 2023
Getting Started with Test-Driven Development at PHPtek 2023Getting Started with Test-Driven Development at PHPtek 2023
Getting Started with Test-Driven Development at PHPtek 2023
 
Testing Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user groupTesting Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user group
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Bug zillatestopiajenkins
Bug zillatestopiajenkinsBug zillatestopiajenkins
Bug zillatestopiajenkins
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
 
Automated Testing Environment by Bugzilla, Testopia and Jenkins
Automated Testing Environment by Bugzilla, Testopia and JenkinsAutomated Testing Environment by Bugzilla, Testopia and Jenkins
Automated Testing Environment by Bugzilla, Testopia and Jenkins
 
A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)
 
Windows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementWindows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server Management
 
Selenium web driver_2.0_presentation
Selenium web driver_2.0_presentationSelenium web driver_2.0_presentation
Selenium web driver_2.0_presentation
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Getting started with Octopus Deploy
Getting started with Octopus DeployGetting started with Octopus Deploy
Getting started with Octopus Deploy
 
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

Continuous Integration: Improving Quality in Moodle

  • 1. Continuous Integration: Improving Quality in Moodle Dan Poltawski Integrator Moodle HQ @dan_p the world’s open source learning platform #mootieuk15
  • 2. the world’s open source learning platform Wide topic, today focusing on: • “Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible.” - Martin Fowler http://www.martinfowler.com/articles/continuousIntegration.html Continuous Integration
  • 3. the world’s open source learning platform Integration Process: 2001 - 2010 Numerous problems: • Single developer may be only person aware of a change • Inconsistency was rife • Developers often unaware of the consequences of some changes • Testing was not enforced • Unit tests were limited and frequently broken New Development Release
  • 4. the world’s open source learning platform Moved to git and brought about a change in development process • Enforced code review • Enforced ‘manual testing’ • Integration team introduced to move towards ensuring more consistency • Introduction of CI systems Integration Process: Today Automated Tests Automated Checks New Development Peer Review Integration Review Testing Release
  • 5. the world’s open source learning platform • Needed automated tests to supplement the manual reviews done by the Integration team • CI Server was setup - Jenkins • Open source/extensible • Self hosted • http://jenkins-ci.org Post-integration checker Automated Tests Automated Checks New Development Peer Review Integration Review Testing Release
  • 6. the world’s open source learning platform Post-integration checker Jenkins polls for changes in integration.gitCode pushed to integration.git Issue status is set (e.g. failed) Detects code changes and starts running checked jobs Jenkins notifies status changes Integration team Jenkins
  • 7. the world’s open source learning platform Post-Integration Checks
  • 8. the world’s open source learning platform Post-integration checks: whitespace • First job to be created (the whitespace police started it all!) • Detect incorrectly spacing added • Frequent error: • Easy to miss setting up your editor for Moodle • Not spotted easily by reviewers
  • 9. the world’s open source learning platform Post-integration checks: compare upgrade & install • Detects DB inconsistencies between install and upgrade code: 1. Runs the installer 2. Run upgrade from a previous version 3. Compares the database schema from both 4. Fails in the case of any differences • Finds schema inconsistencies previously frequently undetected - (common source of number of 1.9 - > 2.x upgrade bugs) • Also brings fringe benefit of testing upgrade code (though limited by lack of data)
  • 10. the world’s open source learning platform • Initially support for Moodle 2.0-2.2 with SimpleTest • Custom CLI generated test data, ran tests and output results as JUnit xml file • Culturally testing was not embedded • Tests rarely run or added by developers • Had to mock everything - no way to setup test data Post-integration checks: Unit testing
  • 11. the world’s open source learning platform • Moodle 2.3 added support for PHPUnit • Data generators significantly improved unit testing experience • Helped move cultural change towards automated tests • Challenges: • Keeping the test time down • ‘Random’ fails Post-integration checks: Unit testing
  • 12. Moodle 2.3 Moodle 2.6 Moodle 2.9 24,273 44,491 58,011 the world’s open source learning platform Unit test assertions
  • 13. the world’s open source learning platform • Many created a result of mistakes slipping through: • Incorrect upgrade savepoints • version.php file check • Check files built correctly (less, shifter, grunt) • php syntax check (php -l) • Unresolved merge conflicts Post-integration checks: Others
  • 14. the world’s open source learning platform • Desirable to check before integration • Can help reduce delays (timezones) by providing more rapid feedback • Better suited to more pedantic checks • Provide supplemental information rather than just pass/fail Pre-integration checker Automated Tests Automated Checks New Development Peer Review Integration Review Testing Release Inline comments must end in full-stops, exclamation marks, or question marks.
  • 15. the world’s open source learning platform Pre-integration checker Merges branch with moodle.git Run pre check jobs against merged branch Produce ‘smurffile’ of changes, filtered by lines affected by patch jshint phpcs csslint phpdoc php -l commit savepoint thirdparty Report summary back to tracker checkstyle.xml
  • 16. the world’s open source learning platform • Not possible to run all our testing scenarios on a per-commit basis due to time to run • Nightly server does these long-running tasks • Behat (Acceptance tests) • Multi-platform tests • phpunit: pgsql, mariadb, mysql, mssql, oracle • behat: firefox, chrome, phantomjs Nightly checks Automated Tests Automated Checks New Development Peer Review Integration Review Testing Release
  • 17. the world’s open source learning platform //Teacher creates a discussion @Test public void teacherCreateDiscussion() throws Exception { //Adding a discussion forum.clickForumLink(this.properties.get("nameOfForum")); forum.clickAddNewDiscussionTopicButton(); forumPosts.enterSubjectField(this.properties.get("teacherSubject")); forumPosts.enterMessage(this.properties.get("teacherMessage")); forumPosts.clickPostToForum(); } Automated UI tests: Selenium Native • Java-based selenium test suite • Not embedded in development process • Tests written by test manager, not developers • Maintained in separate repository Scenarios in 2.3 28
  • 18. the world’s open source learning platform Given I add a "Forum" to section "1" and I fill the form with: | Forum name | Test forum name | | Forum type | Standard forum for general use | | Description | Test forum description | | Subscription mode | Optional subscription | And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | Automated UI tests: Behat • Improving from pure selenium implementation • No java :-) Human-friendly ‘Gherkin’ language • PHP integration code • Tests required to land with features by developers • Culturally embedded Scenarios in 2.9 412
  • 19. the world’s open source learning platform • Many pre-checker ideas • Run phpunit/behat/multi- platform tests in pre-checker (split by component) • Intelligent re-checking when branches get updated • Backup/restore checks • Custom jira fields for prechecker • Automated rejections • Webservices testing • Run all post-check’s in pre-checker • Others as we detect them Future
  • 20. Questions? @dan_p the world’s open source learning platform https://github.com/moodlehq/moodle-local_ci