SlideShare a Scribd company logo
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 Manager
Daniel Herken
 
PowerShell Plus v4.7 Overview
PowerShell Plus v4.7 OverviewPowerShell Plus v4.7 Overview
PowerShell Plus v4.7 Overview
Richard 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 Development
Chris O'Brien
 
MVP 2.0 Final Presentation
MVP 2.0 Final PresentationMVP 2.0 Final Presentation
MVP 2.0 Final Presentation
sammy93
 
Marcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with seleniumMarcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with selenium
Trójmiejska Grupa Testerska
 
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 Tools
Jeff Bramwell
 
Codeception
CodeceptionCodeception
Codeception
Jonathan Lau
 
Selenium Frameworks
Selenium FrameworksSelenium Frameworks
Selenium Frameworks
Dave Haeffner
 
Как не нужно писать 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 2016
Joe Ferguson
 
Mozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10nMozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10n
Henrik Skupin
 
Massively maintained accessibility: WordPress
Massively maintained accessibility: WordPressMassively maintained accessibility: WordPress
Massively maintained accessibility: WordPress
Joseph 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 LLC
Jim 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 - #mootus16
Dan Poltawski
 
Lightweight continuous delivery for small schools
Lightweight continuous delivery for small schoolsLightweight continuous delivery for small schools
Lightweight continuous delivery for small schools
Charles 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 Kubernetes
Appsembler
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
haochenglee
 
Getting started with Jenkins
Getting started with JenkinsGetting started with Jenkins
Getting started with Jenkins
Edureka!
 
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
Virendra 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 Jenkins
Rogue 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
Hudson
8x8
 
Unit test
Unit testUnit test
Unit test
Hieu Le Trung
 
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
Mike Melusky
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
Mihai-Cristian Fratila
 
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
Scott 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 group
Viktor 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 Dapper
Mike Melusky
 
Bug zillatestopiajenkins
Bug zillatestopiajenkinsBug zillatestopiajenkins
Bug zillatestopiajenkins
Samira Kumar Nanda
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
Synapseindiappsdevelopment
 
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
walkerchang
 
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 Management
Sharkrit JOBBO
 
Selenium web driver_2.0_presentation
Selenium web driver_2.0_presentationSelenium web driver_2.0_presentation
Selenium web driver_2.0_presentation
sayhi2sudarshan
 
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
Sauce Labs
 
Getting started with Octopus Deploy
Getting started with Octopus DeployGetting started with Octopus Deploy
Getting started with Octopus Deploy
Karoline 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

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

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