Skip to content

Commit

Permalink
Add confidence builder test
Browse files Browse the repository at this point in the history
  • Loading branch information
cidrblock authored and audgirka committed Aug 29, 2023
1 parent 0f4c166 commit 726b59c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/playbooks/transform-jinja.transformed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,21 @@
msg: "{{ item }}" # <-- jinja2[spacing]
with_items:
- "{{ items }}"

- name: Confirm a deeply nested duplicate error is corrected
ansible.builtin.set_fact:
fact:
dict:
dict:
list:
- one
- two
- dict:
fix: "{{ 'VALUE_1' | lower }}" # <-- jinja2[spacing]
- dict:
fix: "{{ 'VALUE_1' | lower }}" # <-- jinja2[spacing]
- dict:
fix: "{{ 'VALUE_2' | lower }}" # <-- jinja2[spacing]

# It should be noted that even ansible --syntax-check fails to spot the jinja
# error above, but ansible will throw a runtime error when running
16 changes: 16 additions & 0 deletions examples/playbooks/transform-jinja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,21 @@
msg: "{{ item }}" # <-- jinja2[spacing]
with_items:
- "{{ items }}"

- name: Confirm a deeply nested duplicate error is corrected
ansible.builtin.set_fact:
fact:
dict:
dict:
list:
- one
- two
- dict:
fix: "{{'VALUE_1'|lower}}" # <-- jinja2[spacing]
- dict:
fix: "{{'VALUE_1'|lower}}" # <-- jinja2[spacing]
- dict:
fix: "{{'VALUE_2'|lower}}" # <-- jinja2[spacing]

# It should be noted that even ansible --syntax-check fails to spot the jinja
# error above, but ansible will throw a runtime error when running
6 changes: 6 additions & 0 deletions test/test_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ def fixture_runner_result(
True,
id="dep_local_action",
),
pytest.param(
"examples/playbooks/transform-jinja.yml",
7,
True,
id="jinja_spacing",
),
),
)
def test_transformer( # pylint: disable=too-many-arguments, too-many-locals
Expand Down

0 comments on commit 726b59c

Please sign in to comment.