Skip to content
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

Refactored import_playbook tests #951

Merged
merged 1 commit into from
Aug 13, 2020
Merged

Refactored import_playbook tests #951

merged 1 commit into from
Aug 13, 2020

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Aug 13, 2020

Updated our import_playbook tests to match Ansible implementation of import_playbook and to avoid hitting Ansible syntax check failures with our own testing playbooks.

Ansible can only import playbooks at top level, not via tasks thus our testing was incorrect.

Needed-By: #950

@ssbarnea ssbarnea added this to the 4.3.0 milestone Aug 13, 2020
@ssbarnea ssbarnea requested a review from webknjaz August 13, 2020 14:10
@ssbarnea ssbarnea marked this pull request as ready for review August 13, 2020 14:14
Updated our import_playbook tests to match ansible implementation
of import_playbook and to avoid hitting ansible syntax check failures
with our own testing playbooks.

Needed-By: #950
Copy link

@rafaelfolco rafaelfolco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a few comments

assert len(results) == 2
# Assures we detected the issues from imported playbook
assert 'Commands should not change things' in results_text
assert '502' in results_text

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now 502 is expected

test/playbook-import/playbook_imported.yml Show resolved Hide resolved
- hosts: localhost
tasks:
- command: echo "no name" # noqa 502
post_tasks:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer importing as post_tasks, hope this does not lose coverage

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. This is what I wanted.

test/playbook-include/playbook_pre.yml Show resolved Hide resolved
@ssbarnea ssbarnea merged commit 1fac832 into master Aug 13, 2020
@ssbarnea ssbarnea deleted the fix/import_playbook branch August 14, 2020 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants