feat: Add test case for community downloaded roles and collections (#117)

This commit is contained in:
Mohamed El Mouctar Haidara 2022-07-30 20:54:55 +02:00 committed by GitHub
parent 3b0fcf8c8b
commit 89534c1fd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 0 deletions

View file

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

View 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
View 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

View file

@ -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"],
)