molecule
molecule copied to clipboard
Show output of idempotence check
Issue Type
- Feature request
Current behavior
Idempotence test only shows the name of the tasks which failed tests. This is not convenient since it's often not clear how to fix the problem without seeing what changes were.
Desired behavior
Idempotence test should (optionally) show not only the task name but the changes too.
Proposed implementation
Add a positional option for idempotece like "--show-output" Check for this option before the line "util.sysexit_with_message(msg)" so it will be something like this(I don't familiar with a click lib):
if click.options.show_output:
LOG.warn('Idempotence output:')
LOG.warn(output)
util.sysexit_with_message(msg)
Additionally we should be able to set this behavior globally like via molecule.yaml so it could be used when you just run molecule test
Bonus points if the second converge execution will be done with different stdout_callback like actionable or dense - this will only show the changes, so the output will be significantly smaller.
Very useful feature.
I would also really appreciate such a feature. I've been stuck with a problem on the idempotence check for a week now, because a very simple "should-not-fail" task which uses the file
module claims that something was changed. If I could get any output from this command, I might be able to get some clue as to what changed and why, but without it I'm stabbing in the darkness.
@nre-ableton See https://molecule.readthedocs.io/en/stable/faq.html#why-is-my-idempotence-action-failing for now. You can also just use tags: - molecule-idempotence-notest
too.
molecule is mostly used in CI and the idea of going back to role and run converge again(twice) is kinda sad. Especially for roles with long converge time. I'd like to see an error in my CI logs.
I really need that feature. Most probably everyone needs the idempotence failure reason, so it should even be enabled by default.