pcp
[Top] [All Lists]

[RFC] Using Vagrant for QA tests

To: pcp@xxxxxxxxxxx
Subject: [RFC] Using Vagrant for QA tests
From: Ryan Doyle <rdoyle@xxxxxxxxxx>
Date: Thu, 11 Dec 2014 11:58:06 +1100 (EST)
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <1929973019.5471071.1418248733440.JavaMail.zimbra@xxxxxxxxxx>
Thread-index: zbkSVnkS/0XRkKCKwrNqMmsTm+axQA==
Thread-topic: Using Vagrant for QA tests
Hi PCP

Whilst developing the QA test for the activemq PMDA (qa/760), we were using a tool called Vagrant (https://www.vagrantup.com/) to create a self-contained instance of ActiveMQ that we could run the QA test against. It's a tool that helps manage, orchestrate and provision virtual machines.

I've created a branch "vagrant-qa" at the Aconex guthub repository (https://github.com/Aconex/pcp.git) if you'd like to have a look.

Here I've modified the qa/760 script to detect if it is running inside a Vagrant virtual machine and if so, it will download, unpack and start a version of ActiveMQ.

To run this test you would do the following

0. Download and install Vagrant (and VirtualBox)
1. Run `vagrant up` inside the root PCP git repository. This will take some time while it downloads a VM image, sets it up to build PCP and then install the locally build PCP version
2. Run `vagrant ssh`. You're now inside the VM
3. Run `cd /vagrant`. You're now at the root PCP git repository
4. `cd qa/`
5. Run `./check 760`. This will download, install and start ActiveMQ and run the QA test
6. Run `exit`(or Ctrl+D etc..) to get out of the VM
7. Run `vagrant destroy` to delete the VM (the original base image you downloaded off the internet will be kept in ~/.vagrant.d/boxes). Go to step 1 to re-test.

I see a few advantages of using Vagrant to aid QA.
- Anyone can run the QA and they don't need to know how to setup the prerequisites. You can run Windows or MacOS as well
- Set up of the environment required to run the QA test is captured as code
- Vagrant specifically is a mature tool in this space (as opposed to managing your own set of special virtual machines)

Anyway, feedback on this would be appreciated!

----
Ryan Doyle

<Prev in Thread] Current Thread [Next in Thread>