Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
audgirka committed May 18, 2023
1 parent 3783847 commit 9e48e3b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
WSLENV: FORCE_COLOR:PYTEST_REQPASS:TOXENV:GITHUB_STEP_SUMMARY
# Number of expected test passes, safety measure for accidental skip of
# tests. Update value if you add/remove tests.
PYTEST_REQPASS: 797
PYTEST_REQPASS: 798
steps:
- name: Activate WSL1
if: "contains(matrix.shell, 'wsl')"
Expand Down
4 changes: 4 additions & 0 deletions examples/playbooks/tasks/included-task-with-vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: included-task-with-vars | Test
ansible.builtin.debug:
msg: "{{ foo }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: include_task_with_vars | Foo
ansible.builtin.include_tasks: ../tasks/included-task-with-vars.yml
vars:
var_naming_pattern_foo: bar
7 changes: 7 additions & 0 deletions src/ansiblelint/rules/var_naming.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,10 @@ def test_var_naming_with_pattern() -> None:
)
assert result.returncode == RC.SUCCESS
assert "var-naming" not in result.stdout

def test_var_naming_with_include_tasks_and_vars() -> None:
"""Test with include tasks and vars."""
role_path = "examples/roles/var_naming_pattern/tasks/include_task_with_vars.yml"
result = run_ansible_lint(role_path)
assert result.returncode == RC.SUCCESS
assert "var-naming" not in result.stdout

0 comments on commit 9e48e3b

Please sign in to comment.