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

Viewing all changes in revision 31.

  • Committer: Francesco Banconi
  • Date: 2013-02-06 11:56:36 UTC
  • mfrom: (30.1.16 juju-gui)
  • Revision ID: francesco.banconi@canonical.com-20130206115636-eoy4r99x6claq0jo
Add an option to start test server.

Added the "serve-tests" option to the charm, 
defaulting to False. When the option is enabled 
it is possible to run the Juju GUI unit tests 
using https://[sevice url]/test/.

I needed to conditionally add the corresponding 
location to the nginx configuration file. 
I discussed with Gary about possible ways to 
achieve this. Using the standard Python string 
substitution seemed hacky, and the resulting 
template file could be less readable. We decided 
to start using a templating library: ended up with 
tempita because it is lightweight and it is already 
used in maas.

nginx is now configured so that the /test/ location:
- serves unit tests if "serve-tests" is True;
- redirects to / if "serve-tests" is False.
The latter is required because otherwise the test 
location would be added to the browser appcache: 
the index.html file would be served and it references 
the manifest file.

Also fixed dependency management in the install
hook. Now all the Python libraries required by the
charm are installed at the beginning of the process,
before utils, launchpadlib, tempita etc. are imported. 

QA:

- deploy the charm;
- juju set juju-gui serve-tests=true;
- go to "https://[sevice url]/test/";
- you should see tests run (mocha html reporter).

Problems:

test-debug (staging=true) fails to run because 
it attempts to load external (insecure) resources.
Filed bug #1116320.

R=gary.poster, teknico
CC=
https://codereview.appspot.com/7306045

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: