Merge lp:~gmb/charms/oneiric/buildbot-slave/charm-tests into lp:~yellow/charms/oneiric/buildbot-slave/trunk
Status: | Merged |
---|---|
Merged at revision: | 9 |
Proposed branch: | lp:~gmb/charms/oneiric/buildbot-slave/charm-tests |
Merge into: | lp:~yellow/charms/oneiric/buildbot-slave/trunk |
Diff against target: |
416 lines (+155/-206) 8 files modified
.bzrignore (+1/-0) hooks/install (+2/-1) tests/100_buildbot-slave.config.test (+0/-72) tests/200_buildbot-slave.test (+0/-58) tests/buildbot-slave.test (+121/-0) tests/config.test.yaml (+4/-5) tests/get-unit-info (+0/-50) tests/openport.py (+27/-20) |
To merge this branch: | bzr merge lp:~gmb/charms/oneiric/buildbot-slave/charm-tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Benji York (community) | code | Approve | |
Review via email: mp+92098@code.launchpad.net |
Description of the change
Changes from gmb and frankban 2012-02-08:
=======
- We've added new, Python tests to the slave.
- We have two working tests:
- A test that the slave deploys successfully.
- A test that the relation is set up correctly*
- We have a test for deploying the slave with a script, but that currently fails all the time and we can't figure out why; it's disabled for now.
We've had to add some significant time.sleep() calls in order to avoid race conditions, particularly in the relationship test, since Juju does everything asynchronously and you can't rely on it actually having done things until you've checked juju status. I've added XXXs for these where appropriate.
This branch looks good. Here are the suggestions I had:
Instead of creating a command to just call it once (starting on
line 15 of the diff):
- command('chmod', '+x', script)
+ chmod = command('chmod')
+ chmod('+x', script)
I suggest using "run":
run('chmod', '+x', script)
Instead of doing your own wait-for- the-unit- to-come- up loop in wait_for_ unit().
buildbot-slave.test you can use helpers.
We could use a HACKING.txt file like the master.
Regarding (do_not_ )test_script: If I'm understanding correctly the slave-setup- script- works) that we verify
function of the script configuration options, we could test them without
going as far as the openport.py script goes. For example, we could have
a well-known file (say /tmp/the-
does not exist, run a deploy who's configuration specifies a test script
to create the file, and then verify that the file exists.