~hatch/charms/precise/juju-gui/trunk

« back to all changes in this revision

Viewing changes to HACKING.md

  • Committer: Nicola Larosa
  • Date: 2013-01-11 17:49:19 UTC
  • mfrom: (23.1.4 document-gui-charm)
  • Revision ID: nicola.larosa@canonical.com-20130111174919-eos33odriyhag2p2
Update the README and HACKING docs

Update the README.md and HACKING.md docs to reflect the current
status. Add to the former a section and link to the demo/staging
server (https://uistage.jujucharms.com:8080/).

R=gary.poster, frankban
CC=
https://codereview.appspot.com/7103043

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
Hi.  Thanks for looking at the charm.  If you are interested in helping us
6
6
develop, we'd love to hear from you.  Our developer-oriented discussions
7
 
happen on freenode's IRC network in the #juju-gui channel, and you can also
 
7
happen on Freenode's IRC network in the #juju-gui channel, and you can also
8
8
join [the GUI developers mailing list](https://lists.ubuntu.com/mailman/listinfo/juju-gui).
9
9
 
10
 
 
11
10
## Getting Started ##
12
11
 
13
12
First, you need a configured Juju environment: see the Juju docs about
62
61
 
63
62
There are two types of tests for the charm: unit tests and functional tests.
64
63
 
65
 
 
66
64
### Unit Tests ###
67
65
 
68
66
The unit tests do not require a functional Juju environment, and can be run
73
71
Unit tests should be created in the "tests" subdirectory and be named in the
74
72
customary way (i.e., "test_*.py").
75
73
 
76
 
 
77
74
### Functional Tests ###
78
75
 
79
76
Running the functional tests requires a Juju testing environment as provided
96
93
for these tests.  At this time, we recommend using other environments, such as
97
94
OpenStack; but we will periodically check the tests in LXC environments
98
95
because it would be great to be able to use it.  If you do want to use LXC,
99
 
you will need to install the apt-cacher-ng and lxc packages.
 
96
you will need to install the `apt-cacher-ng` and `lxc` packages.
100
97
 
101
98
Currently running tests on a local environment is quite slow (with quantal
102
99
host and precise container at least), so you may want to further increase the
103
100
`jitsu test` command timeout.
104
101
 
105
 
If Jitsu generates errors about not being able to bootstrap...
 
102
If Jitsu generates errors about not being able to bootstrap:
106
103
 
107
104
    CalledProcessError: Command '['juju', 'bootstrap']'...
108
105
 
109
 
...or if it hangs, then you may need to bootstrap the environment yourself and
 
106
or if it hangs, then you may need to bootstrap the environment yourself and
110
107
pass the --no-bootstrap switch to Jitsu.
111
108
 
112
109
## Running the Charm From Development ##
124
121
    juju expose juju-gui
125
122
 
126
123
Now you are working with a test run, as described in
127
 
https://juju.ubuntu.com/docs/write-charm.html#test-run .  The
128
 
`juju debug-hooks` command, described in the same web page, is by far your
129
 
most powerful tool to debug.
 
124
<https://juju.ubuntu.com/docs/write-charm.html#test-run>.  The
 
125
`juju debug-hooks` command, described in the same web page, is your most
 
126
powerful tool to debug.
130
127
 
131
128
When something goes wrong, on your local machine run
132
129
`juju debug-hooks juju-gui/0` or similar.  This will initially put you on the
133
130
unit that has the problem.  You can look at what is going on in
134
 
/var/lib/juju/units/[NAME OF UNIT].  There is a charm.log file to investigate,
135
 
and a charm directory which contains the charm.  The charm directory contains
136
 
the juju-gui and juju directories, so everything you need is there.
 
131
`/var/lib/juju/units/[NAME OF UNIT]`.  There is a charm.log file to
 
132
investigate, and a charm directory which contains the charm.  The charm
 
133
directory contains the `juju-gui` and `juju` directories, so everything you
 
134
need is there.
137
135
 
138
136
If juju recognized an error (for instance, the unit is in an "install-error"
139
137
state) then you can do more.  In another terminal on your local machine, run
144
142
are now responsible for running the install hook.  For instance, in this case,
145
143
you would run
146
144
 
147
 
    $ ./hooks/install
 
145
    ./hooks/install
148
146
 
149
147
You can then watch what is going on.  If something goes wrong, fix it and try
150
148
it again.  Juju will not treat the hook as complete until you end the session