Escaping the Works-On-My-Machine badge Continuous Integration with PDE Build and Git



Similar documents
Build Automation for Mobile. or How to Deliver Quality Apps Continuously. Angelo Rüggeberg

Practicing Continuous Delivery using Hudson. Winston Prakash Oracle Corporation

Hudson Continous Integration Server. Stefan Saasen,

Beginner s guide to continuous integration. Gilles QUERRET Riverside Software

Building, testing and deploying mobile apps with Jenkins & friends

Builder User Guide. Version Visual Rules Suite - Builder. Bosch Software Innovations

Continuous Integration

Continuous Integration and Bamboo. Ryan Cutter CSCI Spring Semester

In depth study - Dev teams tooling

Continuous Integration and Delivery at NSIDC

Continuous Integration

JavaScript Applications for the Enterprise: From Empty Folders to Managed Deployments. George Bochenek Randy Jones

Builder User Guide. Version 5.4. Visual Rules Suite - Builder. Bosch Software Innovations

Developing Eclipse Plug-ins* Learning Objectives. Any Eclipse product is composed of plug-ins

Jenkins Continuous Build System. Jesse Bowes CSCI-5828 Spring 2012

Continuous integration with Jenkins CI

Sonatype CLM Enforcement Points - Continuous Integration (CI) Sonatype CLM Enforcement Points - Continuous Integration (CI)

Introduction to Programming Tools. Anjana & Shankar September,2010

Software Configuration Management and Continuous Integration

Continuous Delivery for Alfresco Solutions. Satisfied customers and happy developers with!! Continuous Delivery!

Delivering Quality Software with Continuous Integration

Continuous Integration with Jenkins. Coaching of Programming Teams (EDA270) J. Hembrink and P-G. Stenberg [dt08jh8

CSE 70: Software Development Pipeline Version Control with Subversion, Continuous Integration with Bamboo, Issue Tracking with Jira

Winning the Battle against Automated Testing. Elena Laskavaia March 2016

Software infrastructure for Java development projects

DevOps. Building a Continuous Delivery Pipeline

GLOBAL CONSULTING SERVICES TOOLS FOR WEBMETHODS Software AG. All rights reserved. For internal use only

SOFTWARE DEVELOPMENT BASICS SED

Source Code Review Using Static Analysis Tools

CPSC 491. Today: Source code control. Source Code (Version) Control. Exercise: g., no git, subversion, cvs, etc.)

Sonatype CLM for Maven. Sonatype CLM for Maven

Pipeline Orchestration for Test Automation using Extended Buildbot Architecture

Team Name : PRX Team Members : Liang Yu, Parvathy Unnikrishnan Nair, Reto Kleeb, Xinyi Wang

TeamCity A Professional Solution for Delivering Quality Software, on Time

Paul Barham Program Manager - Java. David Staheli (dastahel@microsoft.com) Software Development Manager - Java

DRUPAL CONTINUOUS INTEGRATION. Part I - Introduction

Continuous Integration and Automatic Testing for the FLUKA release using Jenkins (and Docker)

DAVE Usage with SVN. Presentation and Tutorial v 2.0. May, 2014

Building, Testing & Deploying Android Apps with Jenkins

S. Bouzefrane. How to set up the Java Card development environment under Windows? Samia Bouzefrane.

Version Control! Scenarios, Working with Git!

Effective feedback from quality tools during development

Continuous Automated Deployment with

Java Software Quality Tools and techniques

Continuous Integration: A case study

Continuous Integration

Build management & Continuous integration. with Maven & Hudson

Leveraging Rational Team Concert's build capabilities for Continuous Integration

Software configuration management

Beginners guide to continuous integration. Gilles QUERRET Riverside Software

Integration in Practice

Continuous Keylane

Continuous Integration Processes and SCM To Support Test Automation

Software Configuration Management Best Practices for Continuous Integration

Web Developer Toolkit for IBM Digital Experience

Accelerate Software Delivery

Jenkins on Windows with StreamBase

OpenMake Dynamic DevOps Suite 7.5 Road Map. Feature review for Mojo, Meister, CloudBuilder and Deploy+

Automated build service to facilitate Continuous Delivery

Continuous Integration For Real: The Perforce Java Platform. Hamish Reid Perforce Software Inc.

Agile ALM. Lightweight tools and Agile strategies MANNING MICHAEL HUTTERMANN. Shelter Island

Continuous Delivery on AWS. Version 1.0 DO NOT DISTRIBUTE

@jenkinsconf. Maintaining huge Jenkins clusters - Have we reached the limit of Jenkins?

Developer Workshop Marc Dumontier McMaster/OSCAR-EMR

Build Management. Context. Learning Objectives

Automated performance testing using Maven & JMeter. George Barnett, Atlassian Software

Maven or how to automate java builds, tests and version management with open source tools

Continuous Integration in Kieker

Software Continuous Integration & Delivery

CoDe:U Git Flow - a Continuous Delivery Approach

SUCCESFUL TESTING THE CONTINUOUS DELIVERY PROCESS

Realizing Continuous Performance Management

Gyrex 0.10 Release Review

GECKO Software. Introducing FACTORY SCHEMES. Adaptable software factory Patterns

PTC Integrity Eclipse and IBM Rational Development Platform Guide

Continuous Integration: Aspects in Automation and Configuration Management

Vladimir Bakhov AT-Consulting +7 (905)

Testing Automation for Distributed Applications By Isabel Drost-Fromm, Software Engineer, Elastic

Android Development. 吳 俊 興 國 立 高 雄 大 學 資 訊 工 程 學 系

Software Development Kit

Understanding class paths in Java EE projects with Rational Application Developer Version 8.0

A GUIDE TO USING CONTINUOUS INTEGRATION WITHIN THE VERIFICATION ENVIRONMENT

Continuous Delivery. Alejandro Ruiz

Implementing Continuous Integration Testing Prepared by:

Sabre Red Apps. Developer Toolkit Overview. October 2014

Selenium Automation set up with TestNG and Eclipse- A Beginners Guide

Advanced Testing and Continuous Integration

2012 Nolio Ltd. All rights reserved

Meister Going Beyond Maven

Modern practices TIE-21100/

Improving your Drupal Development workflow with Continuous Integration

Braindumps.C questions

Continuous Integration: Improving Software Quality and Reducing Risk. Preetam Palwe Aftek Limited

Git Branching for Continuous Delivery

IKAN ALM Architecture. Closing the Gap Enterprise-wide Application Lifecycle Management

E4 development: examples, methods and tools. Eclipse Con France 2014

A Pythonic Approach to Continuous Delivery

Transcription:

Escaping the Works-On-My-Machine badge Continuous Integration with PDE Build and Git Matthias Kempka EclipseSource ` mkempka@eclipsesource.com 2011 EclipseSource September 2011

About EclipseSource Eclipse development and consulting in Germany and around the world Committers and Leaderships in over 10 Eclipse projects, among them Equinox, RAP, EPP 2011 EclipseSource September 2011

The Works-On-My-Machine certificate Compile application code (optionally check out latest changes from other developers) Launch application Execute one simple code path of your code changes (Unless you are certain your code works) Check in changes 2011 EclipseSource September 2011

Release Engineering with Eclipse ` OSGi and p2 have special requirements Build tools with steep learning curve Release engineering is not a normal programming task 2011 EclipseSource September 2011

Choice of the Build system PDE Build/Ant Tycho/Maven Make simple things simple - X Make advanced stuff possible X (X) 5

PDE Build and Git Example ` A working example with PDE Build and Git An example product: Hyperbola Build for a RCP product and Test Automation System independent, mostly self-contained Versioning System: Git 6

PDE Build and Git Example ` A working example with PDE Build and Git Fetch git://github.com/mkempka/hyperbola-pdebuild-demo.git Adjust values in o.e.h.releng/custom.properties Execute ant file o.e.h.releng/build.xml Preconditions: Eclipse BaseBuilder >= Indigo Git must be on your $PATH 7

PDE Build and Git Example ` Scope of this talk Walk through some common challenges of projects in the real life Present common patterns to address these challenges Point to the implementation in the example 8

Problem: Code in SCM does not compile Wrong source code level Forgot to check in a class Developed against different target But: Where should it compile? 9

Solution: Have a Continuous Integration Build Defines the current project sanity CI is an Agile best practice Feedback from an independent server Best run with a CI server, i.e. Jenkins, Bamboo,... Ideally executed soon after a commit 10

Problem: Setting up a new workspace Which projects do I need? Where should they be on the disk? What is my target? Where does the target come from? 11

Solution Workspace Provisioning with Yoxos Target Definition 12

Managing a Target Use Add Content from Software Site and add a p2 repository A target definition against p2 repository at Eclipse will work most of the time potentially very slow Use the p2 mirror application to manage your own mirror See http://wiki.eclipse.org/equinox_p2_repository_mirroring 13

Target content For a RCP application use these features: Eclipse RCP Eclipse RCP Plug-in Developer Resources Eclipse Platform Launchers... Your own To enable the Test framework Eclipse Test Framework PDE JUnit Runner Support - Add-on 14

PDE Build and Git Example ` Build target PDE Build does not understand Target Definitions yet See Bug 266311 In customtargets.xml, step preprocessrepos, use <p2.mirror source="${baserepository}" destination="file:${repobaselocation}/mirrored"> <iu id="org.eclipse.equinox.executable.feature.group version="3.5.0.v20110530-7p7nfufflwul76mart"/>... </p2.mirror> Tip: id and version tag can be copied&pasted from the target definition source 15

Problem: A Software Update is required A customer needs a hotfix for a bug The Master branch has already moved beyond the release state Or you just have to update your software How big is your update? 16

Solution: Release from tags Separate between CI and release builds Release builds are tested and eventually released Release builds contain tagged bundles Tags are managed in map files 17

PDE Build and Git Example ` A map file A map file contains a line per artifact like this: plugin@o.e.h.core=git,tag=v20100110,repo=repo,path=o.e.h.core During the build, the fetch factory will fetch the tag v20100110 tag from repository REPO 18

Map files and CI builds To build the latest version of a specific branch, start the build with -DfetchTag=master For getting useful qualifiers, also use -DforceContextQualifier=$NOW 19

Releasing from map files Edit map files by hand only to Add a plugin/fragment/feature Remove a plugin/fragment/feature Automation for managing the tags Eclipse Releng tool for CVS/SVN Scripts for Git, see Bug 328745 20

Problem: Builds take longer and longer Compiling more often than required Unnecessary compression and extraction Test execution takes a long time 21

Compile only once Compile an Everything feature up front into a p2 repository Use that repository for the next steps Bundle up products Install test feature 22

PDE Build and Git Example ` Separated steps in the example The example has a main build.xml It configures and kicks of 2 consecutive PDE Builds and the test run Compilation Product Assembly Run Tests with Eclipse Testing Framework 23

Categorize and separate test execution Separate fast from long running tests Execute them i.e. at CI Build and Nightly builds Patterntesting library can help with test annotations @IntegrationTest("online access needed") @SmokeTest @RunTestOn(osName = "Windows") @SkipTestOn(osName = "Windows") @Broken(till = "31-Jul-2011") 24

Problem: Poor definition of executed tests Developers rarely execute all tests in the workspace Build has some unknown method of test identification 25

Solution: Define a mandatory test suite The same test suite must be able to run from the workspace and the automated builds Use a test suite that can pick up tests automatically, i.e. Bundle Test Collector 26

PDE Build and Git Example ` BundleTestCollector A bundle o.e.h.alltests contains the class BundleTestCollector (c&p d) the Test Suite(s) public class AllTests { } public static Test suite() { TestSuite result = new TestSuite("All Hyperbola Tests"); BundleTestCollector collector = new BundleTestCollector(); collector.collecttests(result, "o.e.h", "o.e.h", "*_Test"); return result; } 27

Problem: Unknown Test Quality Writing tests is optional in some teams Tests with a high abstraction execute only some code in distant classes 28

Solution: Check your code coverage EclEmma does a good job in the workspace Emma also has an integration in Hudson/Jenkins Use Emma in the build automation 29

Setting up Emma with PDE build Set up test environment Trigger offline instrumentation Execute tests Run Emma report 30

PDE Build and Git Example ` Setting up the Test Environment Unzip your product Install test feature with the p2 director Do not drop files into dropins/ folder, logging output is very unreliable there See o.e.h.releng/03-runtests/build.xml for an example This is the place for additional setup hooks, i.e. server/ database setup 31

Trigger offline instrumentation <!-- this requires emma.jar and emma_ant.jar and emma_ant.properties in your ant classpath --> <taskdef resource="emma_ant.properties" /> <emma enabled="${emma.enabled}"> <instr mode="overwrite" metadatafile="${coverageoutputdir}/ecp.em" filter="my.namespace.*"> <instrpath> <fileset dir="${plugins-dir}"> <include name="my.namespace*.jar"/> </fileset> </instrpath> </instr> </emma> 32

Running the Tests Instrumented code requires Emma classes They are not in the bundle dependencies Put emma-<version>.jar in ${JRE_HOME}/lib/ ext Launch the test run with -Dosgi.parentClassloader=ext 33

Run Emma report <emma enabled="${emma.enabled}"> <report > <infileset dir="${coverageoutputdir}" includes="*.em,*.ec" /> <xml outfile="${coverageoutputdir}/coverage.xml" columns="class, name, method, block"/> <html outfile="${coverageoutputdir}/coverage.html"/> </report> </emma> 34

Configure Hudson/Jenkins Install Emma Plug-in Configure project Enjoy coverage reports 35

PDE Build and Git Example ` Other features in the example Start PDE from an ant build file No need to specify the version of org.eclipse.equinox.launcher_<version>.jar Build feature branches before committing 36

Conclusion Setting up and maintaining a build has many facettes The example has many features already integrated and for similar builds only a handful properties need to be adjusted More about this at http://eclipsesource.com/blogs 37

Image Sources Works on My Machine certificate via Creative Commons Attribution-ShareAlike 3.0 by http:// www.codinghorror.com/blog/2007/03/the-works-on-mymachine-certification-program.html Light Bulb and Warning Icons via Creative Commons Attribution 3.0 Unported by http:// shlyapnikova.deviantart.com 38