Post on 26-Jun-2015
description
Jenkins – a friend of every tester Quality Excites 2014 - Gliwice
HELLO.
2
About The Speakers
3
@alvarus
Test Automation Specialist www.alvarus.org
@lpietrucha
Senior Quality Assurance
Specialist
4 4
AGENDA
1. Introduction
2. A few words about Jenkins
3. Project Pipeline
4. How it works in practice:
Main path
Additional Jobs
5. Job monitoring
Quality Assurance Engineer
5
Test Engineer
vs
6
Continuous Integration: • The practice
• Merging working copies several times a day + building
• To prevent integration problems
Continuous Testing: • The practice in combination with Continuous Integration
• Run automated tests on different levels for each build
• To provide a rapid feedback about the current build
7
Continuous Delivery: • To ensure that application can be rapidly and safely
deployed to production by push of a one button
• Delivering every change to a production-like environment
• Run automated tests
Continuous Deployment: • The next step of Continuous Delivery
• Application passes the automated tests is deployed to
production by push of a one button
Jenkins – Continuous Integration Tool
8
• Project started in 2004
• Free, open-source tool written in Java
• Support many Revision Control Systems
• Support Windows, Linux and Mac OS
• Easy installation and configuration
• Distributed builds
• Allows building/testing/deploying software
projects continuously
• Plenty of plugins
Our Example Project
9
Commit Build Deploy Heartbeat Functional
Tests
Deploy Elsewhere
JavaScript Tests
Checkstyle
Deploy System Integration Tests
Java 8
Maven 3.2
Selenium 2.40.0
Karma 0.10
HOW IT WORKS IN PRACTICE? Take a look at Jenkins and main jobs
10
Job: Build
11
What for?
• Integrate the source code
• Run unit and integration unit tests
• Create a package with application for deployment
How?
• Git Plugin to fetch source code from repository
• Maven command to compile and run tests
• Shell script to create the package for deployment
What else?
• Triggers after every commit
• JUnit test report
Job: Deploy
12
What for?
• Deploy the application on master CI server
How?
• Get artefacts from Build job
• Run shell script
What else?
• Triggers after Build Job
Job: Heartbeat
13
What for?
• To ensure that the application was deployed
on server and is up and running
How?
• Very quick test based on shell script
What else?
• Triggers after Deploy Job
Job: Selenium Tests
14
What for?
• Run functional tests on different browsers
• To check the application from user
perspective (GUI)
How?
• Selenium + Java + Maven
What else?
• Triggers after Heartbeat Job
• Gathers screenshots
• JUnit test report
ADDITIONAL JOBS Important but not in main path
15
Job: JavaScript Tests
16
What for?
• Run unit tests against JS code
How?
• Karma + Jasmine + PhantomJS
What else?
• Triggers after Build Job
• JUnit test report
• Code coverage
Job: Static Analysis
17
What for?
• Check Java code with standards and
guidelines
How?
• Maven + PMD + Checkstyle + FindBugs
What else?
• Triggers after Build Job
• Reports
Job: External Deploy
18
What for?
• Deploy the application on every server*
How?
• Run job with parameters (Build number,
server address, …)
• Run shell script
What else?
• Triggers on demand
Job: Spell Checker
19
What for?
• Scan text displayed on web page and extract
those that may not be spelled correctly.
How?
• Selenium to get web sources
• Shell script + Aspell
What else?
• Archive log file
RADIATOR - JOB MONITORING To immediately see what's happened
20
Radiator – Jenkins Build Monitor
21
What for?
• To monitoring Job statuses in Real Time
How?
• Monitor in the team room
• Small Ruby script
What can the Radiator?
• Displaying jobs statuses
• Displaying last 10 build statuses
• Displaying test result: how many tests failed
• Collecting jobs in logical blocks
References
22
• Jenkins: http://jenkins-ci.org
• Java 8: http://www.oracle.com
• Maven: http://maven.apache.org
• Karma: http://karma-runner.github.io
• Selenium: http://docs.seleniumhq.org
• JUnit: http://junit.org
• Aspell: http://aspell.net
• PhantomJS: http://phantomjs.org
THANK YOU GLIWICE! Any Questions?
23