Top Banner
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)
34

Simple tools to fight bigger quality battle

Oct 31, 2014

Download

Technology

Anand Ramdeo

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.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Simple tools to fight bigger quality battle

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)

Page 2: Simple tools to fight bigger quality battle

www.testinggeek.com

Agenda

• Introduction to CI • How it works

 • CI suitable for our needs

 • Challenges Faced

 • Our Solution

 • Implementation

 • Q/A

Page 3: Simple tools to fight bigger quality battle

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.

Page 4: Simple tools to fight bigger quality battle

www.testinggeek.com

Page 5: Simple tools to fight bigger quality battle

www.testinggeek.com

Why CI ?

• Last minute changes • Resource Crisis

 • Quality was very important for financial

application • Tight schedule

Page 6: Simple tools to fight bigger quality battle

www.testinggeek.com

Challenges

Page 7: Simple tools to fight bigger quality battle

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.

Page 8: Simple tools to fight bigger quality battle

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

Page 9: Simple tools to fight bigger quality battle

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

Page 10: Simple tools to fight bigger quality battle

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

Page 11: Simple tools to fight bigger quality battle

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

Page 12: Simple tools to fight bigger quality battle

www.testinggeek.com

Subversion Repository

Build Machines

Test Machines

VbSend Mail Utility

Page 13: Simple tools to fight bigger quality battle

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

Page 14: Simple tools to fight bigger quality battle

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

Page 15: Simple tools to fight bigger quality battle

www.testinggeek.com

Repo: Config File with machine name and build

Repo: Config File with machine name and task

names

Page 16: Simple tools to fight bigger quality battle

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)

Page 17: Simple tools to fight bigger quality battle

www.testinggeek.com

Build-Machine: Config File with machine name and Test

Page 18: Simple tools to fight bigger quality battle

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

Page 19: Simple tools to fight bigger quality battle

www.testinggeek.com

sendmail.bat

Page 20: Simple tools to fight bigger quality battle

www.testinggeek.com

All sounds quite complex... How about a demo?

Page 21: Simple tools to fight bigger quality battle

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

Page 22: Simple tools to fight bigger quality battle

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

Page 23: Simple tools to fight bigger quality battle

www.testinggeek.com

A Boot Strap Script

 Final output of the script:ROOT- scripts- repo- build-appliance- test-appliance

Page 24: Simple tools to fight bigger quality battle

www.testinggeek.com

boot-strap.bat

It's that simple #1

Page 25: Simple tools to fight bigger quality battle

www.testinggeek.com

post-revs.bat

It's that simple #2

Page 26: Simple tools to fight bigger quality battle

www.testinggeek.com

build-revs.bat

It's that simple #3

Page 27: Simple tools to fight bigger quality battle

www.testinggeek.com

test-revs.bat

It's that simple #4

Page 28: Simple tools to fight bigger quality battle

www.testinggeek.com

SHOW Me the DEMO please #$*#

Page 29: Simple tools to fight bigger quality battle

www.testinggeek.com

setup of CI system using bootstrapper

Page 30: Simple tools to fight bigger quality battle

www.testinggeek.com

CI tasks created by bootstrap

Page 31: Simple tools to fight bigger quality battle

www.testinggeek.com

example developer change

Page 32: Simple tools to fight bigger quality battle

www.testinggeek.com

output from CI system due to change

Page 33: Simple tools to fight bigger quality battle

www.testinggeek.com

QUESTIONS???

Page 34: Simple tools to fight bigger quality battle

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