[result] Result message should be in consistent format

Bug #1948041 reported by Robert Gildein
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-verify
Triaged
Low
Unassigned

Bug Description

We should standardize the format of the results messages of checks,
as some use different format, what cause output to be little bit
confusing.

A good example are results from checking the nova-compute unit.

```bash
$ juju-verify reboot --unit nova-compute/0
Checks:
[OK] check_affected_machines check passed
[OK] check_has_sub_machines check passed
[OK] Unit nova-compute/0 is running 0 VMs.
[OK] Empty Availability Zone check passed.

Overall result: OK (All checks passed)
```

There are three types of messages:
 1. "<exact-check-function-name-with-underscore> check passed"
 2. custom message without mentioning which check it comes
    from (although this is obvious)
 3. "<check-function-name-with-capital-letters> check passed"

I think it should be standardized and mentioned in the contribution.

Changed in juju-verify:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Martin Kalcok (martin-kalcok) wrote :

This is a good point, the output should be consistent.

In my opinion, adding whether the check passed or failed as part of the message body is superfluous, as the message is already pre-faced with [OK], [WARN] or [FAIL].

I also don't think that using underscores in output intended for humans is desired.

I think that good message format should contain:
 - Clear indication of pass/fail
 - Which unit/app/machine is the message related to. (This one is tricky, as not all checks have same scope. Some are per-unit, some are application wide and some are concerned with the machine)
 - Human readable check name
 - Optional additional info. I think that additional info is really only needed in case of failure, checks that pass do not need to burden user with info about why they passed.

What do you think about following format?

[<success>][<unit_or_app_name>] <human readable check name> - <optional info>

Example:
[OK] [Machine 0] Check Affected Machines
[OK] [nova-compute] Availability Zone check
[FAIL] [nova-compute/0] Running VMs check - Unit has 2 running VMs

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.