Skip to content

Commit 3bc33c5

Browse files
committed
Always yield
1 parent d00a681 commit 3bc33c5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/pytest_ansible_network_integration/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def playbook(role: str) -> List[Dict[str, object]]:
159159
:param role: The role's path
160160
:returns: The playbook
161161
"""
162-
task = {"name": f"Run role {role}", "import_role": {"name": role}}
162+
task = {"name": f"Run role {role}", "include_role": {"name": role}}
163163
play = {"hosts": "all", "gather_facts": False, "tasks": [task]}
164164
playbook_obj = [play]
165165
return playbook_obj
@@ -347,15 +347,15 @@ def github_log(request: pytest.FixtureRequest) -> Generator[None, None, None]:
347347
:yields: To the test
348348
"""
349349
if not os.environ.get("GITHUB_ACTIONS"):
350-
return
350+
yield
351+
else:
352+
name = request.node.name
351353

352-
name = request.node.name
354+
_github_action_log(f"::group::Run integration test: '{name}'")
355+
yield
353356

354-
_github_action_log(f"::group::Run integration test: '{name}'")
355-
yield
357+
if hasattr(request.node, "rep_call"):
358+
if request.node.rep_setup.passed and request.node.rep_call.failed:
359+
_github_action_log(f"::error title=Integration test failure::{name}")
356360

357-
if hasattr(request.node, "rep_call"):
358-
if request.node.rep_setup.passed and request.node.rep_call.failed:
359-
_github_action_log(f"::error title=Integration test failure::{name}")
360-
361-
_github_action_log("::endgroup::")
361+
_github_action_log("::endgroup::")

0 commit comments

Comments
 (0)