molecule icon indicating copy to clipboard operation
molecule copied to clipboard

Show output of idempotence check

Open Oloremo opened this issue 5 years ago • 5 comments

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.

Oloremo avatar Jun 13 '19 13:06 Oloremo

Very useful feature.

GLaN1K avatar Jul 09 '19 20:07 GLaN1K

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 avatar Oct 28 '19 17:10 nre-ableton

@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.

decentral1se avatar Oct 29 '19 09:10 decentral1se

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.

Oloremo avatar Oct 29 '19 10:10 Oloremo

I really need that feature. Most probably everyone needs the idempotence failure reason, so it should even be enabled by default.

hunter86bg avatar Dec 07 '20 08:12 hunter86bg