~teknico/charms/precise/juju-gui/encrypt-api-env-connection

« back to all changes in this revision

Viewing changes to README.txt

  • Committer: Nicola Larosa
  • Date: 2012-12-13 13:01:35 UTC
  • mfrom: (9.2.3 1089028-add-hacking-file)
  • Revision ID: nicola.larosa@canonical.com-20121213130135-7ck3cmbhbf0wc81d
Add a HACKING.txt file.

Move testing docs from the README.txt file to a new HACKING.txt, put deploying docs in README.txt .

R=
CC=
https://codereview.appspot.com/6921049

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
This charm makes it easy to deploy a Juju GUI into an existing environment.
6
6
 
7
7
 
8
 
Testing
9
 
=======
10
 
 
11
 
There are two types of tests for the charm: unit tests and functional tests.
12
 
 
13
 
 
14
 
Unit tests
15
 
----------
16
 
 
17
 
The unit tests do not require a functional Juju environment, and can be run
18
 
with this command::
19
 
 
20
 
    python tests/unit.test
21
 
 
22
 
Unit tests should be created in the "tests" subdirectory and be named in the
23
 
customary way (i.e., "test_*.py").
24
 
 
25
 
 
26
 
Functional tests
27
 
----------------
28
 
 
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.
32
 
 
33
 
 
34
 
Functional test setup
35
 
~~~~~~~~~~~~~~~~~~~~~
36
 
 
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)::
40
 
 
41
 
    sudo apt-get install autoconf libtool python-charmhelpers
42
 
    bzr branch lp:~jimbaker/juju-jitsu/unit-test jitsu-unit-test
43
 
    cd jitsu-unit-test
44
 
    autoreconf
45
 
    ./configure --prefix=$HOME
46
 
    make
47
 
    make install
48
 
 
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"::
52
 
 
53
 
    bzr branch lp:~juju-gui/charms/precise/juju-gui/trunk juju-gui
54
 
 
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.
59
 
 
60
 
Now you are ready to run the functional tests (see the next section).
61
 
 
62
 
 
63
 
Running the functional tests
64
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65
 
 
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::
68
 
 
69
 
    JUJU_REPOSITORY=/path/to/charm/repo ~/bin/jitsu test juju-gui \
70
 
        --logdir /tmp --timeout 40m
71
 
 
72
 
This command will bootstrap the default Juju environment specified in your
73
 
``~/.juju/environments.yaml``.
74
 
 
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.
78
 
 
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.
82
 
 
83
 
If Jitsu generates errors about not being able bootstrap::
84
 
 
85
 
    CalledProcessError: Command '['juju', 'bootstrap']'...
86
 
 
87
 
...or it hangs, then you may need to bootstrap the environment yourself and
88
 
pass the --no-bootstrap switch to Jitsu.
89
 
 
90
 
If you do not yet have an environment defined, the Jitsu command
91
 
"setup-environment" is an easy way to get started.
 
8
Deploying the Juju GUI
 
9
======================
 
10
 
 
11
Deploying the Juju GUI is obviously accomplished using Juju itself.
 
12
 
 
13
You need a configured Juju environment: see the Juju docs about
 
14
`getting started <https://juju.ubuntu.com/docs/getting-started.html>`_).
 
15
 
 
16
Then you need to link this checkout of the Juju GUI charm from within the
 
17
charm repository::
 
18
 
 
19
  $ ln -s /path/to/charm/checkout/ /path/to/charm/repo/juju-gui
 
20
 
 
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``.
 
23
 
 
24
Finally, run the following commands::
 
25
 
 
26
  $ juju bootstrap
 
27
  $ juju deploy --config config.yaml juju-gui
 
28
  $ juju expose
 
29
 
 
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/>.