Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
01-xenial-basic
02-xenial-website
03-xenial-slave
04-xenial-external
05-xenial-extension
06-xenial-nrpe
README
basic.py
deployment.py
extension.py
external.py
nrpe.py
slave.py
tests.yaml
website.py

README

This directory provides Amulet tests that focus on verification of Jenkins
deployments.

In order to run tests, you'll need charm-tools installed (in addition to
juju, of course):

    sudo add-apt-repository ppa:juju/stable
    sudo apt-get update
    sudo apt-get install charm-tools

If you use a web proxy server to access the web, you'll need to set the
AMULET_HTTP_PROXY environment variable to the http URL of the proxy server.

To run tests first build the charm then, the recommended way to run tests is
via bundletester, https://github.com/juju-solutions/bundletester. Tests can
also be run directly, ie `./tests/01-xenial-basic`.

For debugging and test development purposes, all code should be idempotent.
In other words, the code should have the ability to be re-run without changing
the results beyond the initial run.  This enables editing and re-running of a
test module against an already deployed environment, as described above.


Notes for additional test writing:

  * Use DEBUG to turn on debug logging, use ERROR otherwise.
      u = OpenStackAmuletUtils(ERROR)
      u = OpenStackAmuletUtils(DEBUG)

  * Preserving the deployed environment:
    Even with juju --set-e, amulet will tear down the juju environment
    when all tests pass.  This force_fail 'test' can be used in basic_deployment.py
    to simulate a failed test and keep the environment.

    def test_zzzz_fake_fail(self):
        '''Force a fake fail to keep juju environment after a successful test run'''
        # Useful in test writing, when used with:   juju test --set-e
        amulet.raise_status(amulet.FAIL, msg='using fake fail to keep juju environment')