1. Continuous Test Automation
Test Automation Framework using
Jenkins CI to drive the execution and
present the results
vireshdoshi@time2test.co.uk 1Feb 2015
2. About
• This presentation details the thinking behind
how I managed to integrate Test Automation
with Continuous Integration for a client in the
Broadcasting technology sector.
vireshdoshi@time2test.co.uk 2Feb 2015
3. Take away message
“Test automation alone is useful but test
automation hooked up with a Continuous
Integration Platform is damn powerful”
Viresh Doshi – February 2015
Feb 2015 vireshdoshi@time2test.co.uk 3
4. About Viresh Doshi
• Test Specialist with over 15 years industry
experience.
• Started out testing Air Traffic Management
Systems for Lockheed Martin.
• Gained Test Consultancy working for one of
the first pure play test consultancies.
• Now help businesses/projects mature the QA,
Agile and Test process.
vireshdoshi@time2test.co.uk 4Feb 2015
5. The problems
• The client was only manually testing with
some adhoc automated unit testing.
• The team was transforming to Agile.
• Team was using Jenkins CI for building
software.
• The test environments were not controlled.
• Multiple teams from the UK, USA and Canada
updating the main code base and difficult to
pinpoint regressions.
vireshdoshi@time2test.co.uk 5Feb 2015
6. The biggest problem
vireshdoshi@time2test.co.uk 6Feb 2015
• The software gets to the client and…
– Software does not install.
– The software is missing a database change.
– The client can not login
– Basic functionality is broken
8. Hold on!
• Jenkins is a build tool and not a testing tool.
vireshdoshi@time2test.co.uk 8Feb 2015
9. The system
Made up of
three key
componentsTest
automation
tool
Jenkins CI
Jenkins
Plugins
GIT –
source code
Control
vireshdoshi@time2test.co.uk 9Feb 2015
10. Test automation tool
• This is any test automation tool that best
compliments the system under test e.g.
– Test Complete
– Selenium
– jMeter
– Quick Test Professional
– Home Grown Code and Tools
vireshdoshi@time2test.co.uk 10Feb 2015
11. GIT source control
• GIT is open source
• Easy to use and manage
• Client tools allow for easy usage
• Integrates with Jenkins CI
• Web management system
• Ideal choice for management of all test
configurable items and test code.
vireshdoshi@time2test.co.uk 11Feb 2015
12. What does it look like?
vireshdoshi@time2test.co.uk 12Feb 2015
13. In more detail?
The radiator view is what we
stare at daily!
Each block is a labeled “job”
that does something.
Green indicates success and
Red/Yellow indicates failure or
issues.
Running progress is shown.
Job run time and version is
shown.
Red blocks need investigating
immediately.
vireshdoshi@time2test.co.uk 13Feb 2015
14. What “things” does it do?
• Smoke tests – functional test coverage of the
key functions of the system
• End to End business scenarios
• New features
• Software installation
• Configuration
• Monitoring of servers , database server and
log files
vireshdoshi@time2test.co.uk 14Feb 2015
15. Test Starting point
• A new production development build is the
initial trigger point
• That build is copied across to the test
automation system and then installed and
then the suite of automation tests are run and
reported.
vireshdoshi@time2test.co.uk 15Feb 2015
16. System Vision and Values
• Continuous installation
• Continuous testing
• Continuous reporting
• Easy to manage
• Source Controlled
• Open Source Technology
• Scalable
vireshdoshi@time2test.co.uk 16Feb 2015
18. About
• This section contains information on the
Jenkins plugins used that achieve Continuous
Test Automation.
Feb 2015 vireshdoshi@time2test.co.uk 18
19. Jenkins
What is Jenkins?
• A CI Build Platform that allows the user to
create build process jobs that do “things”.
• Jenkins Plugins allow the integration and
ability to enrich the “things” being done.
• When those “things” are not successful then a
red fail is reported and it’s possible to drill
down further and investigate problems.
vireshdoshi@time2test.co.uk 19Feb 2015
20. Concepts
• Automate Repetitive tasks
• Report Pass and Fails
• Provide easy access to Log files
• Allow for Parameters
• Integration to existing systems
• Establish a Workspace
vireshdoshi@time2test.co.uk 20Feb 2015
21. Plugin: Build Monitor
What does it do?
• Provides a visual “radiator” view of configured
jobs.
Why?
• The view shows the jobs key features like: how
long it took to execute, running state, pass/fail
and build number.
vireshdoshi@time2test.co.uk 21Feb 2015
22. Plugin: Build Name Setter
What does it do?
• Allows for a user set a build name
Why?
• The standard build name is just an
incremented number.
vireshdoshi@time2test.co.uk 22Feb 2015
23. Plugin: Build Pipeline
What does it do?
• Provides a visual view of upstream and
downstream connected jobs.
Why?
• Builds and jobs can get complicated, so it is
useful to have a visual view of connected jobs.
vireshdoshi@time2test.co.uk 23Feb 2015
24. Plugin: Config slicing
What does it do?
• Allows multiple projects settings to be
adjusted conveniently.
Why?
• A great way to manage configuration settings
when you have 100s of similar Jenkins jobs.
vireshdoshi@time2test.co.uk 24Feb 2015
25. Plugin: Copy Artifact
What does it do?
• Allows artifacts to be copied from other build
projects
Why?
• Useful for taking successful executables from
other projects for usage.
vireshdoshi@time2test.co.uk 25Feb 2015
26. Plugin: Green Balls
What does it do?
• Simply shows a green for Pass and Red for Fail
Why?
• Jenkins automatically uses a colour blind
scheme – orange and yellow.
vireshdoshi@time2test.co.uk 26Feb 2015
27. Plugin: GIT Plugin
What does it do?
• Integrates into GIT source code control.
Why?
• Needed to pull the latest code changes from
source control.
vireshdoshi@time2test.co.uk 27Feb 2015
28. Plugin: HTML Publisher
What does it do?
• A HTML report is published per run
Why?
• It was used to publish the HTML execution
results as created by Test Complete
Automation Tool
vireshdoshi@time2test.co.uk 28Feb 2015
29. Plugin: PowerShell
What does it do?
• Integrates the ability to run PowerShell scripts.
Why?
• PowerShell is a very powerful scripting
language that adds endless possibilities for
windows based servers.
vireshdoshi@time2test.co.uk 29Feb 2015
30. Plugin: jUnit
What does it do?
• A nice graph with a pass/fail report in jUnit
style is presented per run.
Why?
• A test is not a test without a pass/fail result.
Any failures can also display stack traces or
error screenshots.
vireshdoshi@time2test.co.uk 30Feb 2015
31. Plugin: MSBuild
What does it do?
• Allows MSBuild to build .NET projects
Why?
• The executable isbuilt consistently using
Jenkins instead of adhocly on a developer’s
machine.
vireshdoshi@time2test.co.uk 31Feb 2015
32. Plugin: Sidebar Link
What does it do?
• Simply adds a HTML anchor link to the Jenkins
Sidebar
Why?
• To simplify our life!
vireshdoshi@time2test.co.uk 32Feb 2015
33. Plugin: Workspace Cleanup
What does it do?
• Cleans up the workspace before a job is
executed.
Why?
• Only that run’s current artifacts are stored.
vireshdoshi@time2test.co.uk 33Feb 2015
35. Tips
• Try and limit the full suite of tests to 2 hours
execution time.
• Too many builds provided by the developers –
Limit the execution to twice a day.
• Failures could be with problems with the tests
and not the code.
• The system needs to be tested. Watch the test
execution and double check that it is doing
what you expect.
vireshdoshi@time2test.co.uk 35Feb 2015
36. Next Steps
• Introduce Maven or equivalent to manage
dependencies.
• Introduce a first time install test on virtualized
servers.
• Introduce Continuous Delivery
vireshdoshi@time2test.co.uk 36Feb 2015
37. Thank You
I am looking for a new challenge!
vireshdoshi@time2test.co.uk
07970 291828
UK
vireshdoshi@time2test.co.uk 37Feb 2015