1

I've created an automated integration test that uses Vagrant to create an environment with MySQL database, runs my application under test, asserts the database, and finally destroys the Vagrant box. I want to have it run automatically when somebody commits code so I want to create a Jenkins job. The problem is we don't have a dedicated machine for running Vagrant. One of the options that I was suggested is to use AWS. So I finally got "vagrant up --provider=aws" to work. It created an instance but I started to think that we'll have large amount of integration tests constantly creating and destroying EC2 instances. Question: is it a bad idea to create and destroy constantly new instances of EC2?

SBel
  • 3,315
  • 6
  • 29
  • 47

1 Answers1

1

The downside of this approach is, obviously, the cost. In AWS EC2, you pay for each hour that your instance is running and whenever you launch an instance, you are charged for it even if you terminate it immediately (so if you launch an instance 100 times and stop it after each test, you are still paying for 100 hours). Though you still get some free hours in the free tier (I suspect it is 750, so it really depends on how many tests and how frequent are you going to run).

The prices differ for each region and platform and you can save a lot by purchasing a reservations: http://aws.amazon.com/ec2/pricing/

Try taking a look on this SO question - you may find what you need there: How to combine Vagrant with Jenkins for the perfect Continuous Integration Environment?

Community
  • 1
  • 1
Smajl
  • 7,555
  • 29
  • 108
  • 179
  • The integration tests will run on average I think like 1 minute so since I'll be charged for an hour I think it is a bad idea. – SBel Aug 04 '15 at 07:29
  • Generally, I would not recommend this approach, try looking into the other thread. I am sure you will find a better way to achieve this. – Smajl Aug 04 '15 at 07:30