full functional tests for API methods

Eric Snow eric.snow at canonical.com
Mon Jul 21 21:08:13 UTC 2014


We've been working on adding a backup method to the API client.  One
test I wanted to add was a functional test that did no patching
anywhere.  Such an end-to-end test would give us more confidence in
the API method.  We currently have something like that for
backup/restore, but only as a CI test running on jenkins.

As I understand it, there are two roadblocks to getting such a
functional test in our test suite:

1. such a test would drastically slow down our other tests;
2. we don't have an easy way to set up a clean full environment
against which to run the test,

Solving the first should be as simple as only running the test when
some env variable is set (e.g. JUJU_TESTING_INCLUDE_SLOW).

However, solving the second roadblock isn't so trivial.  Ideally the
test would create an LXC into which it would bootstrap.  Then the test
would set up the environment however it needed before running the API
client method against that environment.  I imagine that this could be
addressed with something similar to a local provider but where the
master is also in an LXC (and the kinks with that are worked out).
>From what I understand there has been some discussion on this already.
How hard would it be to do this?

While my interest is specifically for backup/restore, I imagine that
other API client methods (and perhaps other parts of juju) would
benefit from the above functionality.

Thoughts?

-eric



More information about the Juju-dev mailing list