5
5
This charm makes it easy to deploy a Juju GUI into an existing environment.
11
There are two types of tests for the charm: unit tests and functional tests.
17
The unit tests do not require a functional Juju environment, and can be run
20
python tests/unit.test
22
Unit tests should be created in the "tests" subdirectory and be named in the
23
customary way (i.e., "test_*.py").
29
Running the functional tests requires a Juju testing environment as provided
30
by the Jitsu test command. All files in the tests directory which end with
31
".test" will be run in a Juju Jitsu test environment.
37
At the time of this writing the Jitsu test command is not yet released. To run
38
it you must first install it locally. The files may be installed globally, or
39
into your home directory (as here)::
41
sudo apt-get install autoconf libtool python-charmhelpers
42
bzr branch lp:~jimbaker/juju-jitsu/unit-test jitsu-unit-test
45
./configure --prefix=$HOME
49
The current incarnation of the Jitsu test command requires that the current
50
directory name match the charm name, so you must check out the charm into a
51
directory named "juju-gui"::
53
bzr branch lp:~juju-gui/charms/precise/juju-gui/trunk juju-gui
55
The branch directory must be placed (or linked from) within a local charm
56
repository. It consists of a directory, itself containing a number of
57
directories, one for each distribution codename, e.g. ``precise``. In turn, the
58
codename directories will contain the charm repositories.
60
Now you are ready to run the functional tests (see the next section).
63
Running the functional tests
64
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66
Jitsu requires the charm directory be named the same as the charm and it be the
67
current working directory when the tests are run::
69
JUJU_REPOSITORY=/path/to/charm/repo ~/bin/jitsu test juju-gui \
70
--logdir /tmp --timeout 40m
72
This command will bootstrap the default Juju environment specified in your
73
``~/.juju/environments.yaml``.
75
If you are going to run the tests often, you probably want to set up LXC and
76
run the tests locally by setting your default environment to a "local" one.
77
Among other things you will need to install apt-cacher-ng and LXC to do so.
79
Unfortunately, currently running tests on a local environment is quite slow
80
(with quantal host and precise container at least), so you may want to further
81
increase the ``jitsu test`` command timeout.
83
If Jitsu generates errors about not being able bootstrap::
85
CalledProcessError: Command '['juju', 'bootstrap']'...
87
...or it hangs, then you may need to bootstrap the environment yourself and
88
pass the --no-bootstrap switch to Jitsu.
90
If you do not yet have an environment defined, the Jitsu command
91
"setup-environment" is an easy way to get started.
11
Deploying the Juju GUI is obviously accomplished using Juju itself.
13
You need a configured Juju environment: see the Juju docs about
14
`getting started <https://juju.ubuntu.com/docs/getting-started.html>`_).
16
Then you need to link this checkout of the Juju GUI charm from within the
19
$ ln -s /path/to/charm/checkout/ /path/to/charm/repo/juju-gui
21
Deploying parameters may be configured by creating a configuration file in
22
YAML format. A synopsis of the available options is found in ``config.yaml``.
24
Finally, run the following commands::
27
$ juju deploy --config config.yaml juju-gui
30
It will take a while, run ``juju status`` until the unit machine is active.
31
The Juju GUI will then be accessible at <http://unit-machine-name/>.