Top Banner
Intuit Confidential and Proprietary 1 Micro Service Sandbox Test Automation Neeraja R, Staff Engineer, Intuit Apr-14-2016
19

Micro Service Sandbox Test Automation

Apr 07, 2017

Download

Software

intuit_india
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: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary1

Micro Service Sandbox Test AutomationNeeraja R, Staff Engineer, Intuit

Apr-14-2016

Page 2: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary2

• What is that we are solving here?

• How Sand box testing will be helpful in agile delivery/cloud?

• Why we need functional test automation?

• What is sand box testing?

• What is a Micro service

• How sandbox testing can be automated ?

Agenda

Page 3: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary3

Problem Statement

• Developing a new Web Service and no test infra structure is ready yet

• Modifying an existing web service

• Build deployment issues

• Had broken the existing functionality

• New check-in has introduced a defect etc..

Page 4: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary4

Benefits offered by this solution

• Time to market

• Faster Delivery

• Easy to experiment with Customers

• Can do deployment testing

• Easily measure test coverage

• Measure the build quality with every check-in

• Faster identification of defects

• Enables business to be more agile

Page 5: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary5

Why we need functional test automation

• Multiple releases can be done

• Easy to do Regression Testing

• Backward compatibility Testing

• No Manual intervention

• Error prone

• Visual results of test coverage

• Click of a button you can certify the Build

• You can focus more on the building new features/enhancements

Page 6: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary6

What is sand box testing?

• Sandbox Testing is an independent testing without having any dependencies out of the box

• Works on a Single node

• No External Dependencies

• No need to have the test environments

Page 7: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary7

What is a Micro Service

• A Micro service is a independently deployable service with a specific functionality.

• A monolithic system can be broken in to many Micro services

• Can connect different micro services together to achieve a business capability.

• Time to Market

Page 8: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary8

How sandbox testing can be automated ?

Maven Cargo plugin allows you to easily do Sand Box Testing, and in the remainder of the deck I will show you how….

Page 9: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary9

Sandbox testing - How it works

• Works with Maven build lifecycle

• Easy to debug the build

• Can deploy more than one web service

• Configure when to run cargo and disable if not needed

• Proceeds with regression only when deployment is successful

• Automatically cleans up the machine

Page 10: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary10

Sandbox testing – How it works

Install Container

Download container

Install the build

Check if Deployment is

successful or notExecute

functional tests

Stop Container

Uninstall Build

Publish the results

No

Yes

Page 11: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary11

Sandbox testing – How to configure

Cargo can be configured Using

• Maven Build Plugin• Direct API Integration

• Maven Build Plugin is used for Functional End to End Automation

• API Integration is used while writing Junit tests

Page 12: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary12

Sandbox testing – How to configure• Using Maven Build Plugin

• Defining the Phase to be executed

<plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <version>1.1.2</version> <executions> <execution> <id>start-container</id> <phase>pre-integration-test</phase> <goals> <goal>start</goal> <goal>deploy</goal> </goals> </execution> <execution> <id>stop-container</id> <phase>post-integration-test</phase> <goals> <goal>undeploy</goal> <goal>stop</goal> </goals> </execution> </executions>

Page 13: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary13

Sandbox testing – How to configure• Defining Container Location and other Dependencies

<configuration> <wait>false</wait> <container> <containerId>tomcat7x</containerId> <zipUrlInstaller>

<url>http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.42/bin/apache-tomcat-7.0.42.zip</url>

</zipUrlInstaller> <dependencies> <!-- We need clover.jar to be present in container classpath for code coverage --> <dependency> <groupId>com.cenqua.clover</groupId> <artifactId>clover</artifactId> </dependency> <dependency> <location>${basedir}/src/test/resources/conf</location> </dependency> </dependencies>

Page 14: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary14

Sandbox testing – How to configure

• Configuring Container and deployment properties

<systemProperties> <MY_ENV>dev</MY_ENV> <log4j.configuration>file:${basedir}/src/test/resources/log4j.properties </log4j.configuration> <log4j.debug>true</log4j.debug> </systemProperties> <output>${project.build.directory}/tomcat7x/container.log</output>

<log>${project.build.directory}/tomcat7x/cargo.log</log> </container> <configuration> <properties> <cargo.tomcat.ajp.port>6864</cargo.tomcat.ajp.port> <cargo.servlet.port>7777</cargo.servlet.port> <cargo.jvmargs>-Xmx1024m</cargo.jvmargs> </properties> </configuration>

Page 15: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary15

Sandbox testing – How to configure• Configuring Deployables <deployer> <deployables> <deployable> <type>war</type> <location> ${basedir}/../test-ws/${war_dir}/test-ws-${project.version}${war_file} </location> <pingURL>http://localhost:7777/test/health/full</pingURL> <pingTimeout>30000</pingTimeout> <properties> <context>Test</context> </properties> </deployable> <deployable> <type>war</type> <location> ${basedir}/../test-war2/${war_dir}/test-war2-${project.version}.war </location>

Page 16: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary16

Sandbox testing – How to configure

• Checking if deployment Successful or not for further validation

<pingURL>http://localhost:7777/test-war2/health/full</pingURL> <pingTimeout>30000</pingTimeout> <properties> <context>test-war2</context> </properties> </deployable> </deployables> </deployer> <skip>${cargo.disable}</skip> </configuration> </plugin>

Page 17: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary17

Sample Demo Screen shot

Page 18: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary18

References

• https://codehaus-cargo.github.io/cargo/Maven2+plugin.html

Page 19: Micro Service Sandbox Test Automation

Intuit Confidential and Proprietary19

Thank You