Tests Best Practices

José Antonio Rey jose at ubuntu.com
Thu Apr 9 16:17:18 UTC 2015

Hello everyone,

A couple days ago I was going through the docs, and found out that there 
are not best practices or recommendations for tests. Now that we are 
trying to ensure quality, I believe it would be a good idea to have them.

I know that one of the benefits of Juju being so open is that you can 
write your charm or tests in any language. However, having these best 
practices will allow us to set a recommendation for when people are 
getting started, or don't know how to proceed. I understand that this 
may be seen as a limitation, but it is instead a guidance for when 
someone comes to the ecosystem, or wants to get some tips on how to 
write tests.

I was thinking on starting with two points. These are assuming that you 
are using Python and Amulet to write your tests. The first one, the use 
of the unit_tests packages. As a starter with Python, I have found out 
the use of it quite easy, and helps me condensate everything into one 
big file. Which takes me to the second point, having everything in one 
file. This would allow us to save resources and time (since bundletester 
tears down for each file), and would make it look nicer. At least that's 
how I've been proceeding for my last tests.

What do you think? I'm all ears to new suggestions or why these aren't good.

José Antonio Rey

More information about the Juju mailing list