Merge lp:~jimbaker/juju-jitsu/unit-test into lp:juju-jitsu
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Mark Mims | ||||
Approved revision: | 91 | ||||
Merged at revision: | 79 | ||||
Proposed branch: | lp:~jimbaker/juju-jitsu/unit-test | ||||
Merge into: | lp:juju-jitsu | ||||
Diff against target: |
404 lines (+315/-35) 5 files modified
sub-commands/Makefile.am (+3/-1) sub-commands/aiki/cli.py (+6/-1) sub-commands/files/juju (+75/-0) sub-commands/test (+231/-0) sub-commands/topodump (+0/-33) |
||||
To merge this branch: | bzr merge lp:~jimbaker/juju-jitsu/unit-test | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mark Mims (community) | Approve | ||
Review via email: mp+133807@code.launchpad.net |
Description of the change
Adds jitsu test subcommand
Adds new subcommand, jitsu test, that runs unit tests in a charm's tests/ directory.
$ jitsu test --logdir=
Executing this command then results in extensive logging (we may want to consider trimming this down); the key piece for each unit test is something like the following:
PASS: Verify top page is available for mediawiki/0
PASS: Verify top page is available for mediawiki/1
INFO: Completed test ./100_deploy.test
INFO: Passed test results for ./100_deploy.test in /tmp/test-
jitsu test ensures that the specified charm (mediawiki in this example) is deployed from the local repository, specifically the directory from which this test is being run. Otherwise any referenced but not qualified charms are deployed from the charm store.
Unit test ouput is captured in the specified LOGDIR. Note that unit tests can capture additional files by using JITSU_LOGDIR, which is passed as an environment variable to each unit test; it's LOGDIR/
/tmp/test-
.
├── 0
│ └── var
│ └── log
│ └── juju
│ ├── machine-agent.log
│ └── provision-agent.log
├── 1
│ └── var
│ ├── lib
│ │ └── juju
│ │ └── units
│ │ └── mediawiki-0
│ │ └── charm.log
│ └── log
│ └── juju
│ └── machine-agent.log
...
├── passed
└── wget.log
Other useful options include:
--no-bootstrap - so as to reuse an existing set of machines; note that jitsu test will not destroy services, so this would need to be automated outside jitsu test.
--isolate=
Reviewers: mp+133807_ code.launchpad. net,
Message:
Please take a look.
Description:
Adds jitsu test subcommand
Adds new subcommand, jitsu test, that runs unit tests in a charm's
tests/ directory.
$ jitsu test --logdir= /tmp/test- results- 42 mediawiki # --logdir LOGDIR
must be specified
Executing this command then results in extensive logging (we may want to
consider trimming this down); the key piece for each unit test is
something like the following:
PASS: Verify top page is available for mediawiki/0 results- 42/100_ deploy, skips=0
PASS: Verify top page is available for mediawiki/1
INFO: Completed test ./100_deploy.test
INFO: Passed test results for ./100_deploy.test in
/tmp/test-
jitsu test ensures that the specified charm (mediawiki in this example)
is deployed from the local repository, specifically the directory from
which this test is being run. Otherwise any referenced but not qualified
charms are deployed from the charm store.
Unit test ouput is captured in the specified LOGDIR. Note that unit UNIT_TEST_ NAME:
tests can capture additional files by using JITSU_LOGDIR, which is
passed as an environment variable to each unit test; it's
LOGDIR/
/tmp/test- results- 42/100_ deploy$ tree
.
├── 0
│ └── var
│ └── log
│ └── juju
│ ├── machine-agent.log
│ └── provision-agent.log
├── 1
│ └── var
│ ├── lib
│ │ └── juju
│ │ └── units
│ │ └── mediawiki-0
│ │ └── charm.log
│ └── log
│ └── juju
│ └── machine-agent.log
...
├── passed
└── wget.log
Other useful options include:
--no-bootstrap - so as to reuse an existing set of machines; note that
jitsu test will not destroy services, so this would need to be automated
outside jitsu test.
--isolate= ENVIRONMENT - creates an isolated environment using a unique test-$( uuid)), including corresponding .juju/environme nts.yaml. Note that no cleanup of security groups;
name (jitsu-
LOGDIR/
this could be automated in testing through euca2ools.
https:/ /code.launchpad .net/~jimbaker/ juju-jitsu/ unit-test/ +merge/ 133807
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6821104/
Affected files: Makefile. am aiki/cli. py files/juju topodump
A [revision details]
M sub-commands/
M sub-commands/
A sub-commands/
A sub-commands/test
D sub-commands/