DescriptionAdd 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.
https://code.launchpad.net/~frankban/charms/precise/juju-gui/bug-1110816-serve-tests/+merge/146639
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 7
Patch Set 2 : Add an option to start test server. #Patch Set 3 : Add an option to start test server. #
Total comments: 4
Patch Set 4 : Add an option to start test server. #Patch Set 5 : Add an option to start test server. #
MessagesTotal messages: 11
|