Nicola Larosa has proposed merging lp:~teknico/charms/precise/juju-gui/1089028-add-hacking-file into lp:~juju-gui/charms/precise/juju-gui/trunk.
Requested reviews: Juju GUI Hackers (juju-gui) Related bugs: Bug #1089028 in juju-gui: "The charm README.txt file should contain deployment information" https://bugs.launchpad.net/juju-gui/+bug/1089028 For more details, see: https://code.launchpad.net/~teknico/charms/precise/juju-gui/1089028-add-hacking-file/+merge/139484 Add a HACKING.txt file. Move testing docs from the README.txt file to a new HACKING.txt, put deploying docs in README.txt . https://codereview.appspot.com/6921049/ -- https://code.launchpad.net/~teknico/charms/precise/juju-gui/1089028-add-hacking-file/+merge/139484 Your team Juju GUI Hackers is requested to review the proposed merge of lp:~teknico/charms/precise/juju-gui/1089028-add-hacking-file into lp:~juju-gui/charms/precise/juju-gui/trunk.
=== added file 'HACKING.txt' --- HACKING.txt 1970-01-01 00:00:00 +0000 +++ HACKING.txt 2012-12-12 15:13:34 +0000 @@ -0,0 +1,89 @@ +========================== +Juju GUI Charm Development +========================== + + +Testing +======= + +There are two types of tests for the charm: unit tests and functional tests. + + +Unit tests +---------- + +The unit tests do not require a functional Juju environment, and can be run +with this command:: + + python tests/unit.test + +Unit tests should be created in the "tests" subdirectory and be named in the +customary way (i.e., "test_*.py"). + + +Functional tests +---------------- + +Running the functional tests requires a Juju testing environment as provided +by the Jitsu test command. All files in the tests directory which end with +".test" will be run in a Juju Jitsu test environment. + + +Functional test setup +~~~~~~~~~~~~~~~~~~~~~ + +At the time of this writing the Jitsu test command is not yet released. To run +it you must first install it locally. The files may be installed globally, or +into your home directory (as here):: + + sudo apt-get install autoconf libtool python-charmhelpers + bzr branch lp:~jimbaker/juju-jitsu/unit-test jitsu-unit-test + cd jitsu-unit-test + autoreconf + ./configure --prefix=$HOME + make + make install + +The current incarnation of the Jitsu test command requires that the current +directory name match the charm name, so you must check out the charm into a +directory named "juju-gui":: + + bzr branch lp:~juju-gui/charms/precise/juju-gui/trunk juju-gui + +The branch directory must be placed (or linked from) within a local charm +repository. It consists of a directory, itself containing a number of +directories, one for each distribution codename, e.g. ``precise``. In turn, the +codename directories will contain the charm repositories. + +Now you are ready to run the functional tests (see the next section). + + +Running the functional tests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Jitsu requires the charm directory be named the same as the charm and it be the +current working directory when the tests are run:: + + JUJU_REPOSITORY=/path/to/charm/repo ~/bin/jitsu test juju-gui \ + --logdir /tmp --timeout 40m + +This command will bootstrap the default Juju environment specified in your +``~/.juju/environments.yaml``. + +If you are going to run the tests often, you probably want to set up LXC and +run the tests locally by setting your default environment to a "local" one. +Among other things you will need to install apt-cacher-ng and LXC to do so. + +Unfortunately, currently running tests on a local environment is quite slow +(with quantal host and precise container at least), so you may want to further +increase the ``jitsu test`` command timeout. + +If Jitsu generates errors about not being able bootstrap:: + + CalledProcessError: Command '['juju', 'bootstrap']'... + +...or it hangs, then you may need to bootstrap the environment yourself and +pass the --no-bootstrap switch to Jitsu. + +If you do not yet have an environment defined, the Jitsu command +"setup-environment" is an easy way to get started. === modified file 'README.txt' --- README.txt 2012-12-03 10:02:45 +0000 +++ README.txt 2012-12-12 15:13:34 +0000 @@ -5,87 +5,24 @@ This charm makes it easy to deploy a Juju GUI into an existing environment. -Testing -======= - -There are two types of tests for the charm: unit tests and functional tests. - - -Unit tests ----------- - -The unit tests do not require a functional Juju environment, and can be run -with this command:: - - python tests/unit.test - -Unit tests should be created in the "tests" subdirectory and be named in the -customary way (i.e., "test_*.py"). - - -Functional tests ----------------- - -Running the functional tests requires a Juju testing environment as provided -by the Jitsu test command. All files in the tests directory which end with -".test" will be run in a Juju Jitsu test environment. - - -Functional test setup -~~~~~~~~~~~~~~~~~~~~~ - -At the time of this writing the Jitsu test command is not yet released. To run -it you must first install it locally. The files may be installed globally, or -into your home directory (as here):: - - sudo apt-get install autoconf libtool python-charmhelpers - bzr branch lp:~jimbaker/juju-jitsu/unit-test jitsu-unit-test - cd jitsu-unit-test - autoreconf - ./configure --prefix=$HOME - make - make install - -The current incarnation of the Jitsu test command requires that the current -directory name match the charm name, so you must check out the charm into a -directory named "juju-gui":: - - bzr branch lp:~juju-gui/charms/precise/juju-gui/trunk juju-gui - -The branch directory must be placed (or linked from) within a local charm -repository. It consists of a directory, itself containing a number of -directories, one for each distribution codename, e.g. ``precise``. In turn, the -codename directories will contain the charm repositories. - -Now you are ready to run the functional tests (see the next section). - - -Running the functional tests -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Jitsu requires the charm directory be named the same as the charm and it be the -current working directory when the tests are run:: - - JUJU_REPOSITORY=/path/to/charm/repo ~/bin/jitsu test juju-gui \ - --logdir /tmp --timeout 40m - -This command will bootstrap the default Juju environment specified in your -``~/.juju/environments.yaml``. - -If you are going to run the tests often, you probably want to set up LXC and -run the tests locally by setting your default environment to a "local" one. -Among other things you will need to install apt-cacher-ng and LXC to do so. - -Unfortunately, currently running tests on a local environment is quite slow -(with quantal host and precise container at least), so you may want to further -increase the ``jitsu test`` command timeout. - -If Jitsu generates errors about not being able bootstrap:: - - CalledProcessError: Command '['juju', 'bootstrap']'... - -...or it hangs, then you may need to bootstrap the environment yourself and -pass the --no-bootstrap switch to Jitsu. - -If you do not yet have an environment defined, the Jitsu command -"setup-environment" is an easy way to get started. +Deploying the Juju GUI +====================== + +Deploying the Juju GUI is obviously accomplished using Juju itself. + +You need a configured Juju environment: see the Juju docs about +`getting started <https://juju.ubuntu.com/docs/getting-started.html>`_). + +Then you need to link this checkout of the Juju GUI charm from within the +charm repository:: + + $ ln -s /path/to/charm/checkout/ /path/to/charm/repo/juju-gui + +Finally, run the following commands:: + + $ juju bootstrap + $ juju deploy juju-gui + $ juju expose + +It will take a while, run ``juju status`` until the unit machine is active. +The Juju GUI will then be accessible at <http://unit-machine-name/>.
-- Mailing list: https://launchpad.net/~yellow Post to : [email protected] Unsubscribe : https://launchpad.net/~yellow More help : https://help.launchpad.net/ListHelp

