~simpoir/landscape-charm/bootstrap_with_key

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Unit Testing
============

Code changes should be accompanied by unit test cases.  To run the test cases:

    make test


Integration Testing
===================

This charm comes with an integration test suite, which lives in the 'tests'
directory.  You can run it as follows:

    make integration-test

N.B., It will deploy into a the current juju model. It uses the bundletester
command to facilitate this. the `JUJU_MODEL` environment variable can be passed
to specify a different model.  It will use a number of machines to do this test
-- it should work on a local controller (LXD), but could be quite resource
intensive.


Running parts of the integration tests
--------------------------------------

Running all the integration tests may take quite a while, and sometimes
you want to just run the ones that you are working on. To do that, you
can bootstrap the Juju environment yourself, and then use the zope
testrunner directly. For example:

    zope-testrunner3 -vv --path tests --tests-pattern basic --test some_test

If the different services already are deployed, the command above is enough.
But if you run it against an empty environment, you have to remember to pass
along environment variables that affect the deployment, such as
LS_CHARM_SOURCE=lds-trunk-ppa as to generate the secrets and bundles:

    make secrets bundles


Running integration tests on dense MAAS deployment
--------------------------------------------------

It's possible to run the integration tests on a dense MAAS deployment,
where all the services run on the bootstrap node. But given that it's a
bit different from other deployments, you have to explicitly tell that
it's such a deployment using the DENSE_MAAS environment variable. For
example:

    DENSE_MAAS=1 make integration-test-trunk

Or, if you already have the environment bootstrapped:

    DENSE_MAAS=1 LS_CHARM_SOURCE=lds-trunk-ppa zope-testrunner3 -vv \
        --path tests --tests-pattern basic --test some_test


Testing with Dependent Upstream Charms
======================================

To test with the latest revisions of all dependent charms, you can use a 
convenient makefile target:

    make update-charm-revision-numbers

After running this, you can use 'bzr diff bundles' to see what (if any)
changes were made to landscape-deployments.yaml.