Continuous Integration for Databases Steve Jones SQLServerCentral Red Gate Software.

Slides:



Advertisements
Similar presentations
#sqlsatPordenone #sqlsat367 February 28, 2015 Testing your databases Alessandro
Advertisements

USING CI & CD WITH MICROSOFT SQL SERVER Tim Giorgi Senior Software Developer Northwest Evaluation
Agile Testing with Testing Anywhere The road to automation need not be long.
TFS Continuous Global Delivery Vinay Badami Director of Development Visual Studio Microsoft Corporation.
Improving Software Quality with Continuous Integration
Continuous Integration for Databases Learn how to automate your build and test Steve Jones Red Gate Software Part II of the Continuous Delivery for Databases.
#RefreshCache CI - Daily Builds w/Jenkins – an Open Source Continuous Integration Server Nick Airdo Community Developer Advocate Central Christian Church.
By John Boal  Continuous Integration [CI] ◦ Automating the build process ◦ Build the entire system each time any new.
CONTINUOUS INTEGRATION, DELIVERY & DEPLOYMENT ONE CLICK DELIVERY.
@benday #vslive Automated Build, Test & Deploy with TFS, ASP.NET, and SQL Server Benjamin
Craig Berntson
Sumedha Rubasinghe October,2009 Introduction to Programming Tools.
& Dev Ops. Sherwin-Williams & DevOps Introduction to Sherwin-Williams.
Database Change Management One solution to an often complex problem Kevin Hurwitz Headspring Systems
Kako razvijate PL/SQL pakete? File based PL/SQL development Mitja Golouh SIOUG 2006,
Anubha Gupta | Software Engineer Visual Studio Online Microsoft Corp. Visual Studio Enterprise Leveraging modern tools to streamline Build and Release.
Build and Deployment Process Understand NCI’s DevOps and continuous integration requirements Understand NCI’s build and distribution requirements.
Cruise Training Introduction of Continuous Integration.
Continuous Integration for Databases Steve Jones SQLServerCentral Red Gate Software.
Continuous Deployments using SSDT
Automate Your Database Deployments. Get in touch Grant Fritchey.
Get testing with tSQLt Practical examples and automation Steve Jones SQLServerCentral Red Gate Software.
A Practical Approach to Version Control for SQL Server Steve Jones SQLServerCentral Redgate Software.
Others Talk, We Listen. Managing Database Projects in Visual Studio 2013.
DevOps in the cloud Peter’s personal journey on how I found out, I need Dev skills to optimize my ‘Azure’ work… and so do you!!
Automated Build and Test
Bringing DevOps to the Database
Bringing DevOps to the Database
Joonas Sirén, Technology Architect, Emerging Technologies Accenture
Stress Free Deployments with Octopus Deploy
Visual Studio Database Tools (aka SQL Server Data Tools)
Continuous Deployments using SSDT
Trends like agile development and continuous integration speak to the modern enterprise’s need to build software hyper-efficiently Jenkins:  a highly.
Bringing DevOps to the Database
Database version control
4th Forum How to easily offer your application as a self-service template by using OpenShift and GitLab-CI 4th Forum Alberto.
Team Foundation Server – Build-Deploy-Test Workflow
Bringing DevOps to the Database
SQL Server Data Tools Gert Drapers
Continuous Integration For Databases
X in [Integration, Delivery, Deployment]
Dev Test on Windows Azure Solution in a Box
03 | Continuous Deployment
Visual Studio Database Tools (aka SQL Server Data Tools)
Continuous Deployments using SSDT
Bringing DevOps to the Database
Continuous Deployments using SSDT
Continuous Deployments using SSDT
Delivering Business Value Faster
DAT381 Team Development with SQL Server 2005
Your code is not just…your code
Presented by : Chirag Dani & Dhaval Shah
Database version control
Introduction to VSTS Database Professional
Delivering Business Value Faster
From Development to Production: Optimizing for Continuous Delivery
(c) 2011 Microsoft. All rights reserved.
SSDT, Docker, and (Azure) DevOps
SSDT, Docker, and (Azure) DevOps
Erik Vollebekk Application Architect
Adopting a Compliant Database DevOps Process
The Future of Database Development
Adopting a Compliant Database DevOps Process
The Future of Database Development
Jamie Cool Program Manager Microsoft
SSDT, Docker, and (Azure) DevOps
Your code is not just…your code
The Future of Database Development (with containers)
Samir Behara, Senior Developer, EBSCO
Thanks to our Sponsors Platinum Sponsor: Gold Sponsors:
Presentation transcript:

Continuous Integration for Databases Steve Jones SQLServerCentral Red Gate Software

Agenda Goals Who am I? What is Continuous Integration? Fitting in the Delivery Pipeline What is “build” for databases? Testing in a CI process Adding data for realism

Goals Why continuous integration? Testing is important It’s easy – setup and running in an hour Do feel free to ask questions!

Get in touch Steve Jones /in/way0utwest

“Continuous Integration is a practice designed to ensure that your software is always working, and that you get comprehensive feedback in a few minutes as to whether any given change to your system has broken it.” What is continuous integration? Jez Humble, ThoughtWorks, author of “Continuous Delivery”

“Database Continuous Integration is a practice designed to ensure that your database software is always working, and that you get comprehensive feedback in a few minutes as to whether any given change to your system has broken it.” What is continuous integration? database ^ Jez Humble, ThoughtWorks, author of “Continuous Delivery”

Development Continuous integration Build Test Publish Sync ALTER TABLE foo… Deployment script Release management Artifact repository Production Trigger Review, Backup & deploy Source control QA / Test / Pre-production Database release pipeline Continuous Integration DevelopmentProduction Testing Operations Database development and change management Continuous delivery for databases

Continuous Integration

What is build? For application code = compile For database code = database creation script –But only for a new installation! –Upgrade scripts required for existing installations –Need to preserve the state of the data

Tools we need CI server –Perform the build for us –Execute steps we program Choices –TeamCity by JetBrainsTeamCity –Jenkins – open sourceJenkins –Bamboo – AtlassianBamboo –TFS Build - MicrosoftTFS Build –Cruise Control – open sourceCruise Control

Tools we need Database Integration –Check out schema from VCS –Execute against a SQL Server instance. –Run tests –Deploy to Integration Choices –Red Gate DLM Automation SuiteRed Gate DLM Automation Suite –PoSh –.NET scripts/program –?

Tools we need Version Control System (VCS) –Store our database DDL and DML Choices –SubversionSubversion –Team Foundation Server –Git –Mercurial –Visual SourceSafe –etc

Tools we need Testing framework –We need a way to unit test our code easily. –A framework allows us to write tests that we can maintain Choices –tSQLt and SQL TesttSQLtSQL Test –Microsoft Unit TestsMicrosoft Unit Tests –TSQLUnitTSQLUnit –TSTTST –DBUnit

Tools we need Test data –Add known or random data to our CI database. Choices –Red Gate SQL Data GeneratorRed Gate SQL Data Generator –Restore known backup –Custom scripts for data load (DML and/or BCP)

Our story…  We want to set up a CI process fo r our database Our database is in a VCS o We need to automatically build a new database on every check-in

Continuous Integration Setup and data change Demo

The CI Database Setup Developer CI Server Repository Integration Database

The CI Database Setup Developer CI Server Repository Integration Database

CI Process The CI Database Setup Developer CI Server Repository Integration Database

CI Process The CI Database Setup Developer CI Server Repository Integration Database Random Test Database

CI Process The CI Database Setup Developer CI Server Repository Integration Database

Keeping a database up to date With? Schema Static data Why? A corresponding database for the application Maintaining a test database with the latest changes

TESTING Why it’s important

Where does testing happen? Testing isn’t just done in QA Be aware of the cost of fixing a bug

Cost of Bugs

Does the cost of bugs rise?

Testing in Development Low(er) costs –No inter-team interactions –Changes are discrete However –Increased frequency of changes (higher cost)

What is test? For.NET code, Nunit –Runs on a developer’s machine and build server What about the database? –tSQLt is an open source framework for testing SQL Server databases –tSQLt.org –Support via GoogleGroups –SQL Test provides SSMS integration

Our story…  We want to set up a CI process fo r our database Our database is in a VCS We need to automatically build a new database on every check-in o Let’s add a unit test for our code to the CI process.

Testing the Build Demo

Why generate test data? Dev environments are often not realistic Getting production data not always possible Random data can result in surprises Volume testing can find performance issues

Our story…  We want to set up a CI process fo r our database Our database is in a VCS We need to automatically build a new database on every check-in Let’s add a unit test for our code to the CI process. o Let’s generate test data to use in our CI process

Demo Testing with larger data sizes

Two bugs found by Test Data 1.NULL Dates –App code assumed [Date] wouldn’t be NULL –Test data didn’t –Fix was to change [Date] to be NOT NULL 2. Performance of v_Articles –Test passed on dev box –Failed in more “realistic” CI environment

Deployments Scripts Creation scripts –For new installations Upgrade Scripts –For existing installations Developed by comparing our up-to-date database to production/test

Development Continuous integration Build Test Publish Sync ALTER TABLE foo… Deployment script Release management Artifact repository Production Trigger Review, Backup & deploy Source control QA / Test / Pre-production Database release pipeline Continuous Integration DevelopmentProduction Testing Operations Database development and change management Continuous delivery for databases

The End Questions? More information: Please fill out your feedback forms /in/way0utwest

References  development/assets/continuous-integration-using-red-gate-tools.pdf development/assets/continuous-integration-using-red-gate-tools.pdf   defects---do-late-bugs-really-cost-more defects---do-late-bugs-really-cost-more  8:the-cost-of-bugs&catid=1:miscellanous 8:the-cost-of-bugs&catid=1:miscellanous 