← Back to team overview

yellow team mailing list archive

[Merge] lp:~benji/charms/precise/juju-gui/second into lp:~juju-gui/charms/precise/juju-gui/trunk

 

Benji York has proposed merging lp:~benji/charms/precise/juju-gui/second into lp:~juju-gui/charms/precise/juju-gui/trunk.

Requested reviews:
  Juju GUI Hackers (juju-gui)

For more details, see:
https://code.launchpad.net/~benji/charms/precise/juju-gui/second/+merge/134370

Initial project structure, mostly testing.



https://codereview.appspot.com/6850052/

-- 
https://code.launchpad.net/~benji/charms/precise/juju-gui/second/+merge/134370
Your team Juju GUI Hackers is requested to review the proposed merge of lp:~benji/charms/precise/juju-gui/second into lp:~juju-gui/charms/precise/juju-gui/trunk.
=== added file 'README.txt'
--- README.txt	1970-01-01 00:00:00 +0000
+++ README.txt	2012-11-14 21:04:22 +0000
@@ -0,0 +1,71 @@
+==============
+Juju GUI Charm
+==============
+
+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 (replace USER with your user name)::
+
+    bzr branch lp:~jimbaker/juju-jitsu/unit-test jitsu-unit-test
+    cd jitsu-unit-test
+    autoreconf
+    ./configure --prefix=/home/USER
+    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
+
+Now you are ready to run the functional tests (see the next section).
+
+
+Running the functional tests
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Run the functional tests thusly::
+
+    ~/bin/jitsu test juju-gui --logdir /tmp
+
+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.

=== added directory 'tests'
=== added file 'tests/functional-noop.test'
--- tests/functional-noop.test	1970-01-01 00:00:00 +0000
+++ tests/functional-noop.test	2012-11-14 21:04:22 +0000
@@ -0,0 +1,8 @@
+#!/usr/bin/env python2
+
+import sys
+
+# The only requirement for functional tests is that they have a non-zero exit
+# code on error.  This noop is successful, therefore we exit with zero.
+
+sys.exit(0)

=== added file 'tests/test_addition.py'
--- tests/test_addition.py	1970-01-01 00:00:00 +0000
+++ tests/test_addition.py	2012-11-14 21:04:22 +0000
@@ -0,0 +1,13 @@
+#!/usr/bin/env python2
+
+import sys
+import unittest
+
+
+class PassingTest(unittest.TestCase):
+    def test_addition(self):
+        self.assertEqual(1+1, 3)
+
+
+if __name__ == '__main__':
+    sys.exit(unittest.main())

=== added file 'tests/unit.test'
--- tests/unit.test	1970-01-01 00:00:00 +0000
+++ tests/unit.test	2012-11-14 21:04:22 +0000
@@ -0,0 +1,6 @@
+#!/usr/bin/env python2
+
+import unittest
+import sys
+
+sys.exit(unittest.TextTestRunner().run(unittest.TestLoader().discover('.')))


Follow ups