simple tools to fight bigger quality battle
DESCRIPTION
This presentation was given in GTAC 2008 (Also available on www.TestingGeek.com) and discuss the approach of using SVN commit hooks and batch files as continuous integration system.TRANSCRIPT
www.testinggeek.com
Simple tools to fight the bigger Quality Battle
Continuous Integration using batch files and task scheduler
By:
Komal Joshi Director:Atlantis Software Ltd.
Patrick Martin Sr Software Engineer (Consultant)
www.testinggeek.com
Agenda
• Introduction to CI • How it works
• CI suitable for our needs
• Challenges Faced
• Our Solution
• Implementation
• Q/A
www.testinggeek.com
Say Hello to CI..
• Software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day.
• Integration verified by an automated build (including test) integration
errors are detected as quickly as possible. • Significantly reduced integration problems
• Teams develop cohesive software more rapidly and to higher quality
standards.
www.testinggeek.com
www.testinggeek.com
Why CI ?
• Last minute changes • Resource Crisis
• Quality was very important for financial
application • Tight schedule
www.testinggeek.com
Challenges
www.testinggeek.com
Challenges FacedApplication• Delphi based • Standalone desktop
Resources• Few• Not highly technical
So we needed a solution that was:• Easy to implement• Not tied to a specific technology• Could be easily replicated• Should be a simple one click solution.• Easily configurable.
www.testinggeek.com
Solution was
• No heavy weight Client/Server application but task schedulers• No XML but easily configurable text files
• No fuss-setup but one click execution of batch files• 'Out of the box' continous build batch process
www.testinggeek.com
Key Features
• Distributed in nature • No web tools commonly associated with modern distributed
architecture.• The entire system was achieved by simple text files.• No fuss batch files• Open source and simple tools
• Technology Agnostic
www.testinggeek.com
High Level Implementation
developer tester
repository
build appliance
test appliance
App1
more...
more...
App2step 0
step 1
step 2 step 2
App4
App3
step 3
step 4
step 5 - test!
test appliance
www.testinggeek.com
Process Steps
step 0: run the product build script• creates / updates checkout
step 1: develop / test product• can be developer, tester or ad-hoc testing
step 2: commit changes• can be developer, tester or ad-hoc testing
step 3: post-commit actions• repository post-commit actions queues up revisions to be built (perhaps)
step 4: build revision (perhaps)• build appliances run product build script: build if required due to update
step 5: test (perhaps)• test appliances run product update script and test
www.testinggeek.com
Subversion Repository
Build Machines
Test Machines
VbSend Mail Utility
www.testinggeek.com
Overall Flow
repository
post-commit + task drop markers to build machine(s)
tasks on build machines pick up revisions; build
successful build tasks drop test markers; notify
tasks on test machines pick up revision build for test
run tests; archive tested revisions
summarise results and notify team
commit to repository
www.testinggeek.com
Subversion Repository
• Post Commit Hookso Copy the build-markers
• Scheduled tasks after 10 minuteso Poll to check for markerso Kick off scripts to Parse the machines names from .txt fileso Copy the markers to remote machineso Run the scheduled tasks remotely
www.testinggeek.com
Repo: Config File with machine name and build
Repo: Config File with machine name and task
names
www.testinggeek.com
Build Machine
• Build-Scriptso Kicked off by the parameters in Schedule tasks
• Scheduled tasks after 10 minuteso Poll to check for markers/Kicked off remotelyo Kick off scripts passed as parameterso Copy the markers from build-rev to ‘done-revs’o Kick off scripts to Parse the Test machines names +Tests from .txt fileso Copy the markers to test machines
• Config fileso Normal text files containing-
Test machine name Name of tests Type of release (Debug or normal)
www.testinggeek.com
Build-Machine: Config File with machine name and Test
www.testinggeek.com
Test Machine
• Automated-Test-Scriptso Kicked off by the parameters in Schedule tasks
• Scheduled tasks after 10 minuteso Poll to check for markerso Kick off scripts passed as parameters
• Send Mail utility + Logo Mail the results to people in the list from the log
• Any automation toolo Should be invoked from command line
www.testinggeek.com
sendmail.bat
www.testinggeek.com
All sounds quite complex... How about a demo?
www.testinggeek.com
A CI Template
The processCommit to repository • post-commit hook appends new revision notification to revs queue
(asynchronous) post new revision notification • post any revs found into revs queue of build appliance
(asynchronous) build appliance pick-up of revs queue • walk the revs queue: update and if file changes noted, build - move to done-
revs notify teamif successful build then post build notification to test appliance
(asynchronous) test appliance pick-up of revs queue • walk the revs queue: update and test - move to done-revs; notify team
www.testinggeek.com
A Boot Strap Script
The complete bootstrap script simply takes a root folder argument and creates:• the repository + extra folders/files if required in the repo sub-folder• an example project in the repository• the revision queue check task• the folder for the "build appliance" checkout• the folder for the "test appliance" checkout• the post-commit hook• the script to post new revisions• the scheduled task to invoke the post new revisions script• the update/build/test scripts for the appliances in the scripts folder• the scheduled task to update and build the "build appliance"
checkout• the scheduled task to update and test the "test appliance"
checkout
www.testinggeek.com
A Boot Strap Script
Final output of the script:ROOT- scripts- repo- build-appliance- test-appliance
www.testinggeek.com
boot-strap.bat
It's that simple #1
www.testinggeek.com
post-revs.bat
It's that simple #2
www.testinggeek.com
build-revs.bat
It's that simple #3
www.testinggeek.com
test-revs.bat
It's that simple #4
www.testinggeek.com
SHOW Me the DEMO please #$*#
www.testinggeek.com
setup of CI system using bootstrapper
www.testinggeek.com
CI tasks created by bootstrap
www.testinggeek.com
example developer change
www.testinggeek.com
output from CI system due to change
www.testinggeek.com
QUESTIONS???
www.testinggeek.com
Thanks
Contact :Komal Joshi: [email protected] [email protected] Martin: [email protected]
Thanks To our team:Colin Towers, Ben Murray and Fergus Bown