Skip to content

Commit

Permalink
feat: Add test case for community downloaded roles and collections (#117
Browse files Browse the repository at this point in the history
)
  • Loading branch information
haidaraM authored Jul 30, 2022
1 parent 3b0fcf8 commit 89534c1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
pip install -r tests/requirements_tests.txt
pip freeze
sudo apt-get install -y graphviz
ansible-galaxy install -r tests/fixtures/requirements.yml
- name: Pytest
env:
Expand Down
8 changes: 8 additions & 0 deletions tests/fixtures/docker-mysql-galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- hosts: db-servers
roles:
- geerlingguy.mysql

- hosts: compute-servers
roles:
- geerlingguy.docker
9 changes: 9 additions & 0 deletions tests/fixtures/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
collections:
- name: community.general
- name: community.mysql
roles:
- name: geerlingguy.docker
version: 4.2.4
- name: geerlingguy.mysql
version: 3.5.0
12 changes: 12 additions & 0 deletions tests/test_playbook_grapher.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,3 +449,15 @@ def test_with_roles_with_custom_protocol_handlers(request):

for r in res["roles"]:
assert r.find("g/a").get(xlink_ref_selector).startswith(DIR_PATH)


def test_community_download_roles_and_collection(request):
"""
Test if the grapher is able to find some downloaded roles and collections when graphing the playbook
:return:
"""
run_grapher(
"docker-mysql-galaxy.yml",
output_filename=request.node.name,
additional_args=["--include-role-tasks"],
)

0 comments on commit 89534c1

Please sign in to comment.