Merge lp:~frankban/charms/precise/juju-gui/trusty-charm into lp:~juju-gui/charms/precise/juju-gui/trunk

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 179
Proposed branch: lp:~frankban/charms/precise/juju-gui/trusty-charm
Merge into: lp:~juju-gui/charms/precise/juju-gui/trunk
Diff against target: 477 lines (+155/-94)
8 files modified
HACKING.md (+30/-30)
Makefile (+7/-6)
README.md (+87/-26)
config.yaml (+4/-1)
hooks/utils.py (+6/-9)
revision (+1/-1)
tests/20-functional.test (+15/-20)
tests/deploy.py (+5/-1)
To merge this branch: bzr merge lp:~frankban/charms/precise/juju-gui/trusty-charm
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+215867@code.launchpad.net

Description of the change

Trusty charm.

Make the charm work on trusty.
Also update the charm documentation.

QA:
Please run the unit and functional tests
using both precise and trusty.
Follow the instructions in the HACKING file.

https://codereview.appspot.com/88100044/

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :

Reviewers: mp+215867_code.launchpad.net,

Message:
Please take a look.

Description:
Trusty charm.

Make the charm work on trusty.
Also update the charm documentation.

QA:
Please run the unit and functional tests
using both precise and trusty.
Follow the instructions in the HACKING file.

https://code.launchpad.net/~frankban/charms/precise/juju-gui/trusty-charm/+merge/215867

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/88100044/

Affected files (+154, -92 lines):
   M HACKING.md
   M Makefile
   M README.md
   A [revision details]
   M config.yaml
   M hooks/utils.py
   M revision
   M tests/20-functional.test
   M tests/deploy.py

Revision history for this message
Brad Crittenden (bac) wrote :

LGTM.
Will now QA.

https://codereview.appspot.com/88100044/diff/1/HACKING.md
File HACKING.md (left):

https://codereview.appspot.com/88100044/diff/1/HACKING.md#oldcode23
HACKING.md:23: do not yet have an environment defined, the Jitsu command
"setup-environment"
yay, death to jitsu

https://codereview.appspot.com/88100044/diff/1/HACKING.md
File HACKING.md (right):

https://codereview.appspot.com/88100044/diff/1/HACKING.md#newcode24
HACKING.md:24: way to get started. See
https://pypi.python.org/pypi/juju-quickstart.
Do you prefer pypi to the package just because we have tighter control
over it and it may be more up-to-date?

https://codereview.appspot.com/88100044/diff/1/HACKING.md#newcode62
HACKING.md:62: version the charm will be deployed by functional tests.
For instance, to test
This sentence ends clumsily. How about

Since functional tests deploy the charm in the
bootstrap node, setting the default series also selects which series
version the charm will be deployed by functional tests.

https://codereview.appspot.com/88100044/diff/1/HACKING.md#newcode66
HACKING.md:66: Long story short, to run both unit and functional the
tests:
s/the tests/tests/

https://codereview.appspot.com/88100044/diff/1/HACKING.md#newcode128
HACKING.md:128: The `make deploy` command also support specifying the OS
version used to deploy
s/support/supports/

https://codereview.appspot.com/88100044/diff/1/Makefile
File Makefile (right):

https://codereview.appspot.com/88100044/diff/1/Makefile#newcode83
Makefile:83: @echo 'make deploy [JUJU_ENV="my-juju-env"]
[SERIES="trusty"] - Deploy and'
Shouldn't this say SERIES="precise|trusty" or do you just include trusty
because precise is the default?

https://codereview.appspot.com/88100044/diff/1/README.md
File README.md (right):

https://codereview.appspot.com/88100044/diff/1/README.md#newcode47
README.md:47: add additional machines (i.e. the GUI is installed in the
bootstrap node).
Two parenthetic i.e. clauses in one sentence is a red flag. How about:

When possible, Quickstart conserves resources by installing the GUI on
the bootstrap node. This colocation is not possible when using a local
(LXC) environment.

https://codereview.appspot.com/88100044/diff/1/README.md#newcode165
README.md:165: While the Juju GUI itself is a client side JavaScript
application, the charm
trivial: client-side

https://codereview.appspot.com/88100044/diff/1/README.md#newcode166
README.md:166: installation also involves configuring a starting a GUI
server, which is
configuring and starting?

https://codereview.appspot.com/88100044/diff/1/README.md#newcode205
README.md:205: * The legacy server is no longer supported/tested staring
from trusty.
typo:starting

https://codereview.appspot.com/88100044/

184. By Francesco Banconi

Changes as per review.

Revision history for this message
Francesco Banconi (frankban) wrote :

Please take a look.

https://codereview.appspot.com/88100044/diff/1/HACKING.md
File HACKING.md (right):

https://codereview.appspot.com/88100044/diff/1/HACKING.md#newcode24
HACKING.md:24: way to get started. See
https://pypi.python.org/pypi/juju-quickstart.
On 2014/04/15 13:50:16, bac wrote:
> Do you prefer pypi to the package just because we have tighter control
over it
> and it may be more up-to-date?

I prefer PyPI because the page automatically shows the most recent
quickstart README, including installation instructions.

https://codereview.appspot.com/88100044/diff/1/HACKING.md#newcode62
HACKING.md:62: version the charm will be deployed by functional tests.
For instance, to test
On 2014/04/15 13:50:16, bac wrote:
> This sentence ends clumsily. How about

> Since functional tests deploy the charm in the
> bootstrap node, setting the default series also selects which series
> version the charm will be deployed by functional tests.

Done.

https://codereview.appspot.com/88100044/diff/1/HACKING.md#newcode66
HACKING.md:66: Long story short, to run both unit and functional the
tests:
On 2014/04/15 13:50:16, bac wrote:
> s/the tests/tests/

Done.

https://codereview.appspot.com/88100044/diff/1/HACKING.md#newcode128
HACKING.md:128: The `make deploy` command also support specifying the OS
version used to deploy
On 2014/04/15 13:50:16, bac wrote:
> s/support/supports/

Done.

https://codereview.appspot.com/88100044/diff/1/Makefile
File Makefile (right):

https://codereview.appspot.com/88100044/diff/1/Makefile#newcode83
Makefile:83: @echo 'make deploy [JUJU_ENV="my-juju-env"]
[SERIES="trusty"] - Deploy and'
On 2014/04/15 13:50:16, bac wrote:
> Shouldn't this say SERIES="precise|trusty" or do you just include
trusty because
> precise is the default?

Yes, "trusty" is just an example, and "precise" is the default.

https://codereview.appspot.com/88100044/diff/1/README.md
File README.md (right):

https://codereview.appspot.com/88100044/diff/1/README.md#newcode47
README.md:47: add additional machines (i.e. the GUI is installed in the
bootstrap node).
On 2014/04/15 13:50:16, bac wrote:
> Two parenthetic i.e. clauses in one sentence is a red flag. How
about:

> When possible, Quickstart conserves resources by installing the GUI on
the
> bootstrap node. This colocation is not possible when using a local
(LXC)
> environment.

Done.

https://codereview.appspot.com/88100044/diff/1/README.md#newcode165
README.md:165: While the Juju GUI itself is a client side JavaScript
application, the charm
On 2014/04/15 13:50:16, bac wrote:
> trivial: client-side

Done.

https://codereview.appspot.com/88100044/diff/1/README.md#newcode166
README.md:166: installation also involves configuring a starting a GUI
server, which is
On 2014/04/15 13:50:16, bac wrote:
> configuring and starting?

Done.

https://codereview.appspot.com/88100044/diff/1/README.md#newcode205
README.md:205: * The legacy server is no longer supported/tested staring
from trusty.
On 2014/04/15 13:50:16, bac wrote:
> typo:starting

Done, also fixed in the config.yaml.

https://codereview.appspot.com/88100044/

Revision history for this message
Brad Crittenden (bac) wrote :
Revision history for this message
Francesco Banconi (frankban) wrote :

*** Submitted:

Trusty charm.

Make the charm work on trusty.
Also update the charm documentation.

QA:
Please run the unit and functional tests
using both precise and trusty.
Follow the instructions in the HACKING file.

R=bac
CC=
https://codereview.appspot.com/88100044

https://codereview.appspot.com/88100044/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'HACKING.md'
2--- HACKING.md 2014-03-05 14:55:28 +0000
3+++ HACKING.md 2014-04-15 14:24:45 +0000
4@@ -20,8 +20,8 @@
5
6 First, you need a configured Juju environment: see the Juju docs about
7 [getting started](https://juju.ubuntu.com/docs/getting-started.html). If you
8-do not yet have an environment defined, the Jitsu command "setup-environment"
9-is an easy way to get started.
10+do not yet have an environment defined, the Juju Quickstart plugin is an easy
11+way to get started. See https://pypi.python.org/pypi/juju-quickstart.
12
13 You'll also need some system dependencies and developer basics.
14
15@@ -35,17 +35,12 @@
16 You could start hacking now, but there's a bit more to do to prepare for
17 running and writing tests.
18
19-We use the juju-test test command to run our functional and unit tests. At the
20-time of this writing it is not yet released. To run it you must first install
21-it locally, e.g.:
22-
23- bzr checkout --lightweight lp:juju-plugins
24- ln -s juju-plugins/plugins/juju_test.py juju-test
25- export PATH="$PATH":`pwd`
26-
27-Alternatively you may check out lp:juju-plugins and link
28-"juju-plugins/plugins/juju_test.py" as "juju-test" somewhere in your PATH, so
29-that it is possible to execute "juju-test".
30+We use the juju-test test command to run our functional and unit tests. It is
31+available as part of the charm tools package:
32+
33+ sudo add-apt-repository ppa:juju/stable
34+ sudo apt-get update
35+ sudo apt-get install charm-tools
36
37 Before being able to run the suite, test requirements need to be installed
38 running the command:
39@@ -53,15 +48,23 @@
40 make
41
42 The command above will create a ".venv" directory inside "juju-gui/tests/",
43-ignored by DVCSes, containing the development virtual environment with all the
44-testing dependencies. Run "make help" to see all the available make targets.
45-
46-Now you are ready to run the functional and unit tests (see the next section).
47+ignored by version control, containing the development virtual environment with
48+all the testing dependencies.
49+Run "make help" to see all the available make targets.
50
51 ## Testing ##
52
53 There are two types of tests for the charm: unit tests and functional tests.
54-Long story short, to run all the tests:
55+
56+Functional tests make use of a real Juju environment, and thus they need the
57+`~/.juju/environments.yaml` file to be properly configured, including the
58+`default-series` option. Since functional tests deploy the charm in the
59+bootstrap node, setting the default series also selects which series version
60+the charm will be deployed by functional tests. For instance, to test the Juju
61+GUI charm on trusty, set `default-series: trusty` in your
62+`~/.juju/environments.yaml` file. Possible values are `precise` and `trusty`.
63+
64+Long story short, to run both unit and functional tests:
65
66 make test JUJU_ENV="myenv"
67
68@@ -69,9 +72,9 @@
69 your `~/.juju/environments.yaml`, that will be bootstrapped before running the
70 tests and destroyed at the end of the test run.
71
72-Note that the functional tests will not work using an LXC environment. The
73-test co-locates the juju-gui on the bootstrap node, which is not possible in
74-LXC.
75+Note that the **functional tests will not work using an LXC environment**.
76+As mentioned, the test co-locates the juju-gui on the bootstrap node, which is
77+not possible in LXC.
78
79 Please read further for additional details.
80
81@@ -98,15 +101,6 @@
82 `~/.juju/environments.yaml`, that will be bootstrapped before running the
83 tests and destroyed at the end of the test run.
84
85-#### LXC ####
86-
87-Unfortunately, we have not found LXC-based Juju environments to be reliable
88-for these tests. At this time, we recommend using other environments, such as
89-OpenStack; but we will periodically check the tests in LXC environments
90-because it would be great to be able to use it. If you do want to use LXC,
91-you will need to install the `apt-cacher-ng` and `lxc` packages. Also note
92-that at this time juju-core does not support the local provider.
93-
94 ## Running the Charm From Development ##
95
96 If you have set up your environment to run your local development charm,
97@@ -132,6 +126,12 @@
98 you to manually set up a local Juju environment, and preserves, if already
99 created, the testing virtualenv.
100
101+The `make deploy` command also supports specifying the OS version used to
102+deploy the local charm. By default a precise machine is created, but you can
103+run the following to deploy the charm on trusty:
104+
105+ make deploy SERIES=trusty
106+
107 Now you are working with a test run, as described in
108 <https://juju.ubuntu.com/docs/write-charm.html#test-run>. The
109 `juju debug-hooks` command, described in the same web page, is your most
110
111=== modified file 'Makefile'
112--- Makefile 2014-01-21 15:08:17 +0000
113+++ Makefile 2014-04-15 14:24:45 +0000
114@@ -80,10 +80,11 @@
115 @echo -e ' JUJU_ENV is the Juju environment that will be bootstrapped.\n'
116 @echo -e 'make lint - Run linter and pep8.\n'
117 @echo -e 'make clean - Remove bytecode files and virtualenvs.\n'
118- @echo 'make deploy [JUJU_ENV="my-juju-env]" - Deploy and expose the Juju'
119- @echo ' GUI charm setting up a temporary Juju repository. Wait for the'
120- @echo ' service to be started. If JUJU_ENV is not passed, the charm will'
121- @echo ' be deployed in the default Juju environment.'
122+ @echo 'make deploy [JUJU_ENV="my-juju-env"] [SERIES="trusty"] - Deploy and'
123+ @echo ' expose the Juju GUI charm setting up a temporary Juju repository.'
124+ @echo ' Wait for the service to be started. If JUJU_ENV is not passed,'
125+ @echo ' the charm will be deployed in the default Juju environment.'
126+ @echo ' If SERIES is not passed, "precise" is used.'
127
128-.PHONY: all clean deploy ensure-juju-test ensure-juju-env ftest help \
129- jujutest lint setup test unittest
130+.PHONY: all clean deploy ensure-juju-env ensure-juju-test ftest help \
131+ jujutest lint setup sysdeps test unittest
132
133=== modified file 'README.md'
134--- README.md 2014-01-15 14:59:56 +0000
135+++ README.md 2014-04-15 14:24:45 +0000
136@@ -13,8 +13,8 @@
137
138 ## Supported Browsers ##
139
140-The Juju GUI supports recent releases of the Chrome, Chromium and Firefox web
141-browsers.
142+The Juju GUI supports recent releases of the Chrome, Chromium, Firefox, Safari
143+and Internet Explorer web browsers.
144
145 ## Demo and Staging Servers ##
146
147@@ -25,9 +25,35 @@
148 A [staging server](http://comingsoon.jujucharms.com/) is also available,
149 running the latest and greatest version.
150
151-## Deploying the Juju GUI ##
152-
153-Deploying the Juju GUI is accomplished using Juju itself.
154+## Deploying the Juju GUI using Juju Quickstart ##
155+
156+[Juju Quickstart](https://pypi.python.org/pypi/juju-quickstart) is an
157+opinionated command-line tool that quickly starts Juju and the GUI, whether
158+you've never installed Juju or you have an existing Juju environment running.
159+
160+For installation on precise and saucy, you'll need to enable the Juju PPA by
161+first executing:
162+
163+ sudo add-apt-repository ppa:juju/stable
164+ sudo apt-get update
165+ sudo apt-get install juju-quickstart
166+
167+For trusty the PPA is not required and you simply need to install it with:
168+
169+ sudo apt-get install juju-quickstart
170+
171+At this point, just running `juju-quickstart` will deploy the Juju GUI. When
172+possible, Quickstart conserves resources by installing the GUI on the bootstrap
173+node. This colocation is not possible when using a local (LXC) environment.
174+
175+Quickstart ends by opening the browser and automatically logging the user into
176+the GUI, to observe and manage the environment visually.
177+By default, the deployment uses self-signed certificates. The browser will ask
178+you to accept a security exception once.
179+
180+## Deploying the Juju GUI the traditional way ##
181+
182+Deploying the Juju GUI can be accomplished using Juju itself.
183
184 You need a configured and bootstrapped Juju environment: see the Juju docs
185 about [getting started](https://juju.ubuntu.com/docs/getting-started.html),
186@@ -35,12 +61,17 @@
187
188 juju bootstrap
189
190-Next, you simply need to deploy the charm and expose it. (See also "Deploying
191-with Jitsu" below, for another option.)
192+Next, you simply need to deploy the charm and expose it.
193
194 juju deploy juju-gui
195 juju expose juju-gui
196
197+The instructions above cause you to use a separate machine to work with the
198+GUI. If you'd like to reduce your machine footprint (and perhaps your costs),
199+you can colocate the GUI with the Juju bootstrap node, e.g.:
200+
201+ juju deploy juju-gui --to 0
202+
203 Finally, you need to identify the GUI's URL. It can take a few minutes for the
204 GUI to be built and to start; this command will let you see when it is ready
205 to go by giving you regular status updates:
206@@ -73,8 +104,8 @@
207 you to accept a security exception once.
208
209 You will see a login form with the username fixed to "user-admin". The
210-password is the same as your Juju environment's `admin-secret`, found in
211-`~/.juju/environments.yaml`.
212+password is the same as your Juju environment's `admin-secret`. The login
213+screen includes hints about where to find the environment's password.
214
215 ### Deploying behind a firewall ###
216
217@@ -129,23 +160,53 @@
218 In this case the new version will be found in the local repository and
219 therefore the charm will not attempt to connect to Launchpad.
220
221-### Deploying to a chosen machine ###
222-
223-The instructions above cause you to use a separate machine to work with the
224-GUI. If you'd like to reduce your machine footprint (and perhaps your costs),
225-you can colocate the GUI with the Juju bootstrap node.
226-
227-This approach might change in the future (possibly with the Juju shipped with
228-Ubuntu 13.10), so be warned.
229-
230-The instructions differ depending on the Juju implementation.
231-
232-#### juju-core ####
233-
234-Replace "juju deploy cs:precise/juju-gui" from the previous
235-instructions with this:
236-
237- juju deploy --force-machine 0 cs:precise/juju-gui
238+## The Juju GUI server ##
239+
240+While the Juju GUI itself is a client-side JavaScript application, the charm
241+installation also involves configuring and starting a GUI server, which is
242+required to serve the application files and to enable some advanced features,
243+so that using the GUI results in a seamless and powerful experience.
244+
245+### Builtin server ###
246+
247+By default, a builtin server is installed and started by the charm.
248+The builtin server is already included in the charm. For this reason, it does
249+not require any external dependencies.
250+The builtin server provides the following functionalities:
251+
252+1. It serves the Juju GUI static files, including support for ETags and basic
253+ server side URL routing.
254+2. It supports running the GUI over TLS (HTTPS) or in insecure mode (HTTP).
255+3. It redirects secure WebSocket connections established by the browser to
256+ the real Juju API endpoint. This way the GUI can connect the WebSocket to
257+ the host and port where it is currently running, so that the already
258+ accepted self signed certificate is reused and the connection succeeds.
259+4. It supports running the Juju GUI browser tests if the charm is configured
260+ accordingly.
261+5. It exposes an API for bundles deployment. This way bundles can be deployed
262+ very easily using the GUI, by selecting a bundle from the GUI browser or
263+ just dragging and dropping a bundle YAML file to the GUI canvas.
264+6. It allows for logging in into the GUI via a timed token. This is used, for
265+ instance, by Juju Quickstart to allow automatic user's authentication.
266+7. It supports deploying local charms by proxying browser HTTPS connections to
267+ the Juju HTTPS API backend. This also includes retrieving and listing local
268+ charms' files.
269+
270+### Legacy server ###
271+
272+By switching the charm option `builtin-server` to `false`, the charm configures
273+and start the legacy server in place of the builtin one. This configuration
274+requires retrieving HAProxy from an external PPA and uses HAProxy and Apache to
275+serve the Juju GUI.
276+
277+Using the builtin server is the encouraged configuration, but if you decide to
278+stick with the legacy server, be warned about the following limitations:
279+
280+* The legacy server is no longer supported/tested starting from trusty.
281+ Use it only if the charm is deployed on a precise machine.
282+* The legacy server only provides features 1-4 from the list above. This means
283+ bundle deployments, timed authentication tokens and local charms are not
284+ available when using the legacy configuration.
285
286 ## Contacting the Developers ##
287
288
289=== modified file 'config.yaml'
290--- config.yaml 2014-02-04 20:07:31 +0000
291+++ config.yaml 2014-04-15 14:24:45 +0000
292@@ -150,13 +150,16 @@
293 description: |
294 Enable the built-in server, disabling both haproxy and Apache.
295 This is a temporary option: the built-in server will be
296- the only server in the future.
297+ the only server in the future. Note that legacy server is no longer
298+ supported/tested starting from trusty. Switch this option to false only
299+ if the charm is deployed on a precise machine.
300 type: boolean
301 default: true
302 builtin-server-logging:
303 description: |
304 Set the GUI server log level. Possible values are debug, info, warning
305 and error. The log file is placed in /var/log/upstart/guiserver.log.
306+ This option is ignored if builtin-server is set to false.
307 type: string
308 default: info
309 nagios_context:
310
311=== modified file 'hooks/utils.py'
312--- hooks/utils.py 2014-02-28 15:33:29 +0000
313+++ hooks/utils.py 2014-04-15 14:24:45 +0000
314@@ -606,21 +606,18 @@
315 revision = revision[1:]
316 # We have to unshallow the checkout in order to be able to 'see'
317 # older commit hashes to check them out.
318+ # Note that "git fetch --unshallow" was introduced after precise.
319 cmd_log(run(
320 'git', '--git-dir', git_dir, '--work-tree',
321 juju_gui_source_dir, 'fetch', '--depth', '20000'))
322-
323- cmd_log(run(
324- 'git', '--git-dir', git_dir, '--work-tree',
325- juju_gui_source_dir, 'checkout', revision))
326 else:
327 cmd_log(run(
328 'git', '--git-dir', git_dir, '--work-tree',
329- juju_gui_source_dir, 'fetch', 'origin'))
330- cmd_log(run(
331- 'git', '--git-dir', git_dir, '--work-tree',
332- juju_gui_source_dir, 'checkout', '-b', revision,
333- 'origin/' + revision))
334+ juju_gui_source_dir, 'fetch', '--depth', '1',
335+ 'origin', '{0}:{0}'.format(revision)))
336+ cmd_log(run(
337+ 'git', '--git-dir', git_dir, '--work-tree',
338+ juju_gui_source_dir, 'checkout', revision))
339
340 log('Preparing a Juju GUI release.')
341 logdir = os.path.dirname(logpath)
342
343=== modified file 'revision'
344--- revision 2014-04-09 13:16:08 +0000
345+++ revision 2014-04-15 14:24:45 +0000
346@@ -1,1 +1,1 @@
347-110
348+111
349
350=== modified file 'tests/20-functional.test'
351--- tests/20-functional.test 2014-02-27 21:02:33 +0000
352+++ tests/20-functional.test 2014-04-15 14:24:45 +0000
353@@ -35,6 +35,7 @@
354 from helpers import (
355 get_admin_secret,
356 juju_destroy_service,
357+ juju_status,
358 make_service_name,
359 WebSocketClient,
360 )
361@@ -47,31 +48,22 @@
362 except ValueError as err:
363 admin_secret = None
364 print(err)
365+bootstrap_node_series = juju_status()['machines']['0']['series']
366
367
368 def juju_deploy_gui(options=None):
369 """Deploy the Juju GUI charm with the given options.
370
371- Deploy the charm in the bootstrap node if possible in the current Juju
372- implementation. Use a random service name.
373+ Deploy the charm in the bootstrap node, using the bootstrap node series
374+ and giving to the resulting service a random name.
375
376- Return a tuple containing the deployed service name, unit info and a list
377- of services that are started in the Juju GUI unit and that must be
378- manually stopped by tests. In juju-core, the services list is always empty.
379+ Return a tuple containing the deployed service name and unit info.
380 """
381 service_name = make_service_name(prefix='juju-gui-')
382 unit_info = juju_deploy(
383 'juju-gui', service_name=service_name, options=options,
384- force_machine=0)
385- cleanup_services = []
386- if options is None:
387- options = {}
388- # Either stop the builtin server or the old apache2/haproxy setup.
389- if options.get('builtin-server') == 'true':
390- cleanup_services.append('guiserver')
391- else:
392- cleanup_services.extend(['haproxy', 'apache2'])
393- return service_name, unit_info, cleanup_services
394+ force_machine=0, series=bootstrap_node_series)
395+ return service_name, unit_info
396
397
398 class DeployTestMixin(object):
399@@ -176,7 +168,7 @@
400
401 def test_stable_release(self):
402 # Ensure the stable Juju GUI release is correctly set up.
403- self.service_name, unit_info, _ = juju_deploy_gui(
404+ self.service_name, unit_info = juju_deploy_gui(
405 options={'juju-gui-source': 'stable'})
406 hostname = unit_info['public-address']
407 self.navigate_to(hostname)
408@@ -185,7 +177,7 @@
409
410 def test_sandbox(self):
411 # The GUI is correctly deployed and set up in sandbox mode.
412- self.service_name, unit_info, _ = juju_deploy_gui(
413+ self.service_name, unit_info = juju_deploy_gui(
414 options={'sandbox': 'true'})
415 hostname = unit_info['public-address']
416 self.navigate_to(hostname)
417@@ -198,16 +190,19 @@
418 def test_branch_source(self):
419 # Ensure the Juju GUI is correctly deployed from a Git branch.
420 options = {'juju-gui-source': JUJU_GUI_TEST_BRANCH}
421- self.service_name, unit_info, _ = juju_deploy_gui(options=options)
422+ self.service_name, unit_info = juju_deploy_gui(options=options)
423 hostname = unit_info['public-address']
424 self.navigate_to(hostname)
425 self.handle_browser_warning()
426 self.assertEnvironmentIsConnected()
427
428+ @unittest.skipUnless(
429+ bootstrap_node_series == 'precise',
430+ 'the legacy server is only supported on precise')
431 def test_legacy_server(self):
432 # The legacy apache + haproxy server configuration works correctly.
433 # Also make sure the correct cache headers are sent.
434- self.service_name, unit_info, _ = juju_deploy_gui(
435+ self.service_name, unit_info = juju_deploy_gui(
436 options={'builtin-server': 'false'})
437 hostname = unit_info['public-address']
438 self.navigate_to(hostname)
439@@ -232,7 +227,7 @@
440 def setUpClass(cls):
441 # Deploy the charm. The resulting service is used by all the tests
442 # in this test case.
443- cls.service_name, unit_info, cls.cleanup_services = juju_deploy_gui()
444+ cls.service_name, unit_info = juju_deploy_gui()
445 cls.hostname = unit_info['public-address']
446 # The counter is used to produce API request identifiers.
447 cls.counter = itertools.count()
448
449=== modified file 'tests/deploy.py'
450--- tests/deploy.py 2014-01-16 19:25:52 +0000
451+++ tests/deploy.py 2014-04-15 14:24:45 +0000
452@@ -57,7 +57,7 @@
453
454 def juju_deploy(
455 charm_name, service_name=None, options=None, force_machine=None,
456- charm_source=None, series='precise'):
457+ charm_source=None, series=None):
458 """Deploy and expose the charm. Return the first unit's public address.
459
460 Also wait until the service is exposed and the first unit started.
461@@ -66,12 +66,16 @@
462 If options are provided, they will be used when deploying the charm.
463 If force_machine is not None, create the unit in the specified machine.
464 If charm_source is None, dynamically retrieve the charm source directory.
465+ If series is None, the series specified in the SERIES environment variable
466+ is used if found, defaulting to "precise".
467 """
468 # Note: this function is used by both the functional tests and
469 # "make deploy": see the "if main" section below.
470 if charm_source is None:
471 # Dynamically retrieve the charm source based on the path of this file.
472 charm_source = os.path.join(os.path.dirname(__file__), '..')
473+ if series is None:
474+ series = os.getenv('SERIES', '').strip() or 'precise'
475 logging.debug('setting up the charms repository')
476 repo = setup_repository(charm_name, charm_source, series=series)
477 args = ['deploy', '--repository', repo]

Subscribers

People subscribed via source and target branches