juju for testing purposes

Clint Byrum clint at ubuntu.com
Thu Nov 24 15:49:48 UTC 2011


Excerpts from Marc Tardif's message of Thu Nov 24 06:37:08 -0800 2011:
> Hi folks,
> 
> I have a project that would benefit from regular testing across Ubuntu
> releases since Lucid but the project isn't really big enough to bother
> with a Continuous Integration setup. Would juju be a good solution to
> branch the code in the cloud, build the development environment, run
> the tests and have the results returned to my local machine?
> 

Because it is easier to deal with than ec2-run-instances or some of the
other cloud wrappers, it might be. You'd basically have a charm with an
install hook that ran all of your tests, and then did something with them
to get them back to you. 

That bit about getting them back to your local machine may not fly
though. Juju is designed to scale to many thousands of instances, so
everything is asynchronous. So you're going to have to find a way to get
it back to you.. if the results are small, email might be the simplest
method. Also the install hook can't tell the machine to terminate. So
you'd end up doing something like this

juju deploy my-tester
< wait for tests to run and email to come in
juju destroy-service my-tester

I think for what you're talking about, just running your test over SSH
would work fine. For that there is cloud-run-instances.

cloud-run-instances --verify=ssh --ssh-run-cmd="sh -c 'add-apt-repository -y ppa:you/yourppa && apt-get install my-tester && /usr/bin/my-tests" --teardown `ubuntu-cloudimg-query lucid`

cloud-run-instances is available in cloud-utils and has had the
--verify=ssh stuff since 10.10. ubuntu-cloudimg-query is newer.. I think
since 11.04 or maybe even 11.10. You can just substitute that for an
explicit ami-xxxxxx.



More information about the Juju mailing list