Enterprise Build And Test In The Cloud
JavaOne 2009 San Francisco
http://www.carlossanchez.eu
Building and testing software can be a time- and resource-consuming task. Cloud computing/on-demand services such as Amazon EC2 provide a cost-effective way to scale applications and, for building and testing software, can reduce the time needed to find and correct problems, meaning a cost reduction as well.
Properly configuring your build tools (Maven, Ant,...), continuous integration servers (Continuum, Cruise Control,...), and testing tools (TestNG, Selenium,...) can enable you to run all the building/testing process in a cloud environment, simulating high-load environments, distributing long-running tests to reduce their execution time, using different environments for client or server applications, and so on -- and in the case of on-demand services such as Amazon EC2, pay only for the time you use it.
In this presentation we will introduce a development process and architecture using popular open source tools for the build and test process such as Apache Maven or Ant for building, Apache Continuum as continuous integration server, TestNG and Selenium for testing, and how to configure them to achieve the best results and performance in several typical use cases (long running testing processes, different client platforms,...) by using he Amazon Elastic Computing Cloud EC2, and therefore reducing time and costs compared to other solutions.
2. About me
> Sr. Solutions
Architect at G2iX
> Member of Apache
Maven PMC,
Continuum, Archiva
> Eclipse IAM co-lead
> etc...
2
3. Index
1. The tools
2. Maven Integration Tests
3. Maven & Selenium
4. Adding Continuum to the Mix
5. Testing in Different Environments
6. And Now in the Cloud
3
18. Integration Tests: Selenium
> UI and Integration testing
> Tests run in the browser
• support for multiple browsers
> Tests can be recorded
• no need for developers writing tests
• Selenium IDE Firefox plugin
47. Continuum
> Build the webapp if
• the webapp changes
28
48. Continuum
> Build the webapp if
• the webapp changes
• the dependencies change
28
49. Continuum
> Build the webapp if
• the webapp changes
• the dependencies change
> Run the integration tests
28
50. Continuum
> Build the webapp if
• the webapp changes
• the dependencies change
> Run the integration tests
• if the ITs change
28
51. Continuum
> Build the webapp if
• the webapp changes
• the dependencies change
> Run the integration tests
• if the ITs change
• if the webapp changes
28
53. Selenium headless
> Most likely needed
> Use *nix X Virtual Frame Buffer
> In Maven
• selenium:xvfb
30
54. breakpoint
> Selenium tests in Maven IT project
> running locally in the browser
> triggered by Continuum when there is any change
to webapp, tests or dependencies
31
78. Predictions cost money
Infrastructure
Cost $
Predicted
Demand
Traditional
Hardware
time
Source: Amazon
79. Predictions cost money
Infrastructure
Cost $
Large
Capital
Expenditure
Predicted
Demand
Traditional
Hardware
time
Source: Amazon
80. Predictions cost money
Infrastructure
Cost $
Predicted
Demand
Traditional
Hardware
time
Source: Amazon
81. Predictions cost money
Infrastructure
Cost $
Predicted
Demand
Traditional
Hardware
Actual
Demand
time
Source: Amazon
82. Predictions cost money
Infrastructure
Cost $
Predicted
Demand
Opportunity Traditional
Cost Hardware
Actual
Demand
time
Source: Amazon
83. Predictions cost money
Infrastructure
Cost $
You just lost
customers
Predicted
Demand
Opportunity Traditional
Cost Hardware
Actual
Demand
time
Source: Amazon
84. Predictions cost money
Infrastructure
Cost $
Predicted
Demand
Traditional
Hardware
Actual
Demand
Automated
Virtualization
time
Source: Amazon
93. Amazon AMIs
> Create AMIs for different environments to test
51
94. Amazon AMIs
> Create AMIs for different environments to test
> Read user data to customize the images at runtime
• where is the Selenium Hub
51
95. Maven EC2 plugin
> in progress
> http://mojo.codehaus.org/maven-ec2-plugin
• start Amazon AMIs
• stop at the end of the build
• pass on user data
52