Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(455)

Issue 6821104: Adds jitsu test subcommand

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 5 months ago by jimbaker
Modified:
11 years, 5 months ago
Reviewers:
mp+133807
Visibility:
Public.

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 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-results-42/100_deploy, skips=0 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/UNIT_TEST_NAME: /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 name (jitsu-test-$(uuid)), including corresponding LOGDIR/.juju/environments.yaml. Note that no cleanup of security groups; 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)

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+317 lines, -35 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M sub-commands/Makefile.am View 2 chunks +3 lines, -1 line 0 comments Download
M sub-commands/aiki/cli.py View 2 chunks +6 lines, -1 line 0 comments Download
A sub-commands/files/juju View 1 chunk +75 lines, -0 lines 0 comments Download
A sub-commands/test View 1 chunk +231 lines, -0 lines 0 comments Download
D sub-commands/topodump View 1 chunk +0 lines, -33 lines 0 comments Download

Messages

Total messages: 1
jimbaker
11 years, 5 months ago (2012-11-10 21:14:44 UTC) #1
Please take a look.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b