The test command should provide more detailed output.

Bug #1342773 reported by Matt Bruzek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Charm Tools
Won't Fix
Undecided
Unassigned

Bug Description

While writing automated script that calls "juju test" I wanted to parse the output of the command:

/tmp/bundles/trusty/apache2$ juju test -v --logdir /tmp/bundle_test_output/ --timeout 9m --on-timeout skip

The output that was logged in the /tmp/bundle_test_output/ directory contained no indication that the result was for the apache2 bundle. The output to the console was more informative as it contained more details about the deployment. It would be nice to see the output from the console in the output file. Or perhaps log the abs path of where the test is run from. The current information in the output file gives no indication which bundle was tested, I suspect the same is for charms.

The output in /tmp/bundle_test_output/juju-test.1405517294.log contains no specifics about which bundle was run.

2014-07-16 13:28:14,753 juju-test INFO : Starting test run on local using Juju 1.20.1
2014-07-16 13:28:14,754 juju-test DEBUG : Loading configuration options from testplan YAML
2014-07-16 13:28:14,754 juju-test DEBUG : Creating a new Conductor
2014-07-16 13:28:15,262 juju-test.conductor DEBUG : Starting a bootstrap for local, kill after 300
2014-07-16 13:28:15,262 juju-test.conductor DEBUG : Running the following: juju bootstrap -e local
2014-07-16 13:28:44,285 juju-test.conductor DEBUG : Waiting for bootstrap
2014-07-16 13:28:44,286 juju-test.conductor DEBUG : Still not bootstrapped
2014-07-16 13:28:49,291 juju-test.conductor DEBUG : Running the following: juju status -e local
2014-07-16 13:28:51,828 juju-test.conductor DEBUG : State for 1.20.1: pending
2014-07-16 13:28:51,834 juju-test.conductor DEBUG : Still not bootstrapped
2014-07-16 13:28:56,840 juju-test.conductor DEBUG : Running the following: juju status -e local
2014-07-16 13:28:57,838 juju-test.conductor DEBUG : State for 1.20.1: started
2014-07-16 13:28:57,838 juju-test.conductor.10-automated-test.py DEBUG : Running 10-automated-test
.py (tests/10-automated-test.py)
2014-07-16 13:31:07,559 juju-test.conductor.10-automated-test.py DEBUG :
2014-07-16 13:31:07,559 juju-test.conductor.10-automated-test.py RESULT : ✔
2014-07-16 13:31:07,560 juju-test.conductor DEBUG : Running the following: juju status -e local
2014-07-16 13:31:08,571 juju-test.conductor DEBUG : Running the following: juju status -e local
2014-07-16 13:31:09,552 juju-test.conductor.10-automated-test.py WARNING : Failed to fetch logs for
bootstrap node
2014-07-16 13:31:09,552 juju-test.conductor DEBUG : Running the following: juju status -e local
2014-07-16 13:31:10,718 juju-test.conductor.10-automated-test.py WARNING : Failed to grab logs for r
elation-sentry/0
2014-07-16 13:31:10,719 juju-test.conductor DEBUG : Tearing down local juju environment
2014-07-16 13:31:10,719 juju-test.conductor DEBUG : Calling "juju destroy-environment -y local"
2014-07-16 13:31:19,646 juju-test INFO : Results: 0 passed, 1 failed, 0 errored

The console output from the command contains more details which I was hoping to see in the output file. Using this output I can see that apache2 was deployed.

juju-test INFO : Starting test run on local using Juju 1.20.1
juju-test DEBUG : Loading configuration options from testplan YAML
juju-test DEBUG : Creating a new Conductor
juju-test.conductor DEBUG : Starting a bootstrap for local, kill after 300
juju-test.conductor DEBUG : Running the following: juju bootstrap -e local
uploading tools for series [precise trusty]
Logging to /home/ubuntu/.juju/local/cloud-init-output.log on remote host
Bootstrapping Juju machine agent
Starting Juju machine agent (juju-agent-ubuntu-local)
juju-test.conductor DEBUG : Waiting for bootstrap
juju-test.conductor DEBUG : Still not bootstrapped
juju-test.conductor DEBUG : Running the following: juju status -e local
juju-test.conductor DEBUG : State for 1.20.1: pending
juju-test.conductor DEBUG : Still not bootstrapped
juju-test.conductor DEBUG : Running the following: juju status -e local
juju-test.conductor DEBUG : State for 1.20.1: started
juju-test.conductor.10-automated-test.py DEBUG : Running 10-automated-test.py (tests/10-automated-
test.py)
2014-07-16 13:29:00 Starting deployment of local
2014-07-16 13:29:02 Deploying services...
2014-07-16 13:29:03 Deploying service apache2 using local:trusty/apache2
2014-07-16 13:29:06 Deploying service apache2-sentry using local:trusty/apache2-sentry
2014-07-16 13:29:09 Deploying service relation-sentry using local:trusty/relation-sentry
2014-07-16 13:29:18 Config specifies num units for subordinate: apache2-sentry
2014-07-16 13:30:02 Adding relations...
2014-07-16 13:30:03 Adding relation apache2:juju-info <-> apache2-sentry:juju-info
2014-07-16 13:31:03 Exposing service 'apache2-sentry'
2014-07-16 13:31:04 Exposing service 'relation-sentry'
2014-07-16 13:31:04 Deployment complete in 124.44 seconds
/home/ubuntu/mbruzek/amulet/amulet/sentry.py:46: ResourceWarning: unclosed <ssl.SSLSocket fd=6, fami
ly=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=6, laddr=('10.0.3.1', 49682), raddr=('1
0.0.3.21', 9001)>
  return self.query('/juju').json()
/home/ubuntu/mbruzek/amulet/amulet/sentry.py:46: ResourceWarning: unclosed <ssl.SSLSocket fd=6, fami
ly=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=6, laddr=('10.0.3.1', 58993), raddr=('1
0.0.3.52', 9001)>
  return self.query('/juju').json()
.
----------------------------------------------------------------------
Ran 1 test in 129.528s

OK
juju-test.conductor.10-automated-test.py DEBUG :
juju-test.conductor.10-automated-test.py RESULT : ✔
juju-test.conductor DEBUG : Running the following: juju status -e local
juju-test.conductor DEBUG : Running the following: juju status -e local
juju-test.conductor.10-automated-test.py WARNING : Failed to fetch logs for bootstrap node
juju-test.conductor DEBUG : Running the following: juju status -e local
Warning: Permanently added '10.0.3.21' (ECDSA) to the list of known hosts.
Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(226) [Receiver=3.1.0]
juju-test.conductor.10-automated-test.py WARNING : Failed to grab logs for relation-sentry/0
juju-test.conductor DEBUG : Tearing down local juju environment
juju-test.conductor DEBUG : Calling "juju destroy-environment -y local"
juju-test INFO : Results: 0 passed, 1 failed, 0 errored

Matt Bruzek (mbruzek)
description: updated
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

With bundletester replacing juju test/charm test in the future we're going to pass on anymore work on this

Changed in charm-tools:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.