-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add args for verify and side_effect actions #3467
Merged
Merged
+96
−70
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d0693f1
to
529a7ea
Compare
I have no permissions to set tags on PR. It's ready for review, tests are green. |
feat: add args for verify and side_effect actions This feature allows to provide alternative location for tests or side effects playbook in test sequence like this: ``` test_sequence: - create - converge - verify - side_effect side_effect1.yml - verify tests_for_effect1/ - side_effect side_effect2.yml - verify tests_for_effect2/ ``` This allows to create more comprehensive tests for resulting system, allowing, in particular, to check if it's works as intended: * after server reboot * after applying system changes and reverting them back * after introducing external stress Classic approach with one-side-effect per scenario can create high overhead for both converge operations (if they are long), and maintenance (because each scenario directory need to be kept up-to-date). This patch keep original behavior intact. If no arguments are provided to verify and side_effect actions, they uses values from molecule.yml. If there is action argument, they * replace side effect playbook with list of playbooks after `side_effect` action (in molecule.yml), relative to molecule.yml file. * replace tests (and `additional_files_or_dirs`) with list of locations (relative to `molecule.yml`), while keeping all other test settings intact. This is supported for both verifiers (testinfra and ansible). Signed-off-by: George Shuklin <george.shuklin@gmail.com>
wow, I really like this! |
ssbarnea
approved these changes
Mar 31, 2022
This is not in the docs, right? |
@nkakouros unfortunately, it would not be the first time updating the doc is forgotten. If you have time, a PR with a doc update would be nice or at least, please open a bug report to make sure that it's not forgotten / lost ? |
Closed
rbrunckhorst
referenced
this pull request
in meffie/molecule-robotframework
Jun 21, 2022
Molecule 4.0.0 makes some breaking changes, so limit our version to 3.x until we catch up.
kannanr
added a commit
to kannanr/molecule-inspec
that referenced
this pull request
Aug 31, 2022
ansible/molecule#3467 adds action_args to self._config.verifier.execute at verify.py line 74
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This feature allows to provide alternative location for
tests or side effects playbook in test sequence like this:
This allows to create more comprehensive tests for
resulting system, allowing, in particular, to check
if it's works as intended, f.e.:
Classic approach with one-side-effect per scenario can create
high overhead for both converge operations (if they are long),
and maintenance (because each scenario directory need to be
kept up-to-date).
This patch keep original behavior intact. If no arguments
are provided to verify and side_effect actions, they uses
values from molecule.yml. If there is action argument, they
side_effect
action (in molecule.yml), relative to molecule.yml file.additional_files_or_dirs
) with list oflocations (relative to
molecule.yml
), while keepingall other test settings intact. This is supported for both
verifiers (testinfra and ansible).