canonical / juju-verify

https://launchpad.net/juju-verify
GNU General Public License v3.0
2 stars 7 forks source link

exit at the first failed check #132

Closed esunar closed 1 year ago

esunar commented 1 year ago

There should be a way to prevent all checks from running and stop at the first failed check.

I suggest this because the check may take too long and the user will prefer a quick response over a detailed one. At the same time, there are checks that are bonded together. For example, if the Ceph cluster is not healthy due to a lack of ceph-osd units, then further checking whether the ceph-osd unit can be removed does not make much sense.

I think the best option would be to add the "--stop-on-failure" argument.

How does it work:

(juju-verify) ➜  juju-verify git:(bug/1917600-new) ✗ juju-verify reboot --units ceph-osd/0 ceph-osd/1
Result: FAIL
Reason: ceph-mon/0: Ceph cluster is healthy
The minimum number of replicas in 'ceph-osd' is 1 and it's not safe to restart/shutdown 2 units. 0 units are not active.
It's not safe to removed units ['ceph-osd/0', 'ceph-osd/1'] in the availability zone root=default. [free_units=1]

How it could work:

(juju-verify) ➜  juju-verify git:(bug/1917600-new) ✗ juju-verify reboot --units ceph-osd/0 ceph-osd/1 --stop-on-failure
Result: FAIL
Reason: ceph-mon/0: Ceph cluster is healthy
The minimum number of replicas in 'ceph-osd' is 1 and it's not safe to restart/shutdown 2 units. 0 units are not active.

Imported from Launchpad using lp2gh.

esunar commented 1 year ago

(by rgildein) PR: https://github.com/canonical/juju-verify/pull/26