mirror of
https://github.com/haidaraM/ansible-playbook-grapher
synced 2024-11-10 06:04:15 +00:00
feat: Add test case for community downloaded roles and collections (#117)
This commit is contained in:
parent
3b0fcf8c8b
commit
89534c1fd3
4 changed files with 30 additions and 0 deletions
1
.github/workflows/testing.yaml
vendored
1
.github/workflows/testing.yaml
vendored
|
@ -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:
|
||||
|
|
8
tests/fixtures/docker-mysql-galaxy.yml
vendored
Normal file
8
tests/fixtures/docker-mysql-galaxy.yml
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
- hosts: db-servers
|
||||
roles:
|
||||
- geerlingguy.mysql
|
||||
|
||||
- hosts: compute-servers
|
||||
roles:
|
||||
- geerlingguy.docker
|
9
tests/fixtures/requirements.yml
vendored
Normal file
9
tests/fixtures/requirements.yml
vendored
Normal file
|
@ -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
|
|
@ -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"],
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue