Adds jitsu test subcommand
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-jitsu |
Fix Released
|
Undecided
|
Jim Baker |
Bug Description
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=
Related branches
- Mark Mims (community): Approve
-
Diff: 404 lines (+315/-35)5 files modifiedsub-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)
Changed in juju-jitsu: | |
assignee: | nobody → Jim Baker (jimbaker) |
status: | New → In Progress |
Changed in juju-jitsu: | |
status: | In Progress → Fix Released |