Skip to content

Commit

Permalink
test: Add python_version to test facts gather ansible_python_version (#…
Browse files Browse the repository at this point in the history
…148)

Enhancement: Gather python_version is tests_config.yml to gather
ansible_python_version fact

Reason: The role didn't gather ansible_python_version but used it in
tests_fcontext.yml, hence this test failed on Ansible-2.14 on RHEL 8.10

Result: The bug is fixed
  • Loading branch information
spetrosi authored Feb 14, 2024
1 parent 26a2bae commit 93d416c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/tests_config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: Test cockpit_* role options
hosts: all
gather_facts: false
roles:
- role: linux-system-roles.cockpit
vars:
Expand All @@ -19,6 +20,20 @@
tasks:
- name: Tests
block:
# For now, keeping this task in-place. Can be moved to a separate task
# file in case this is needed in other tests.
# Without this task, the test fails on Ansible-2.14 on RHEL 8.10
- name: Ensure ansible_facts used by this test
vars:
__cockpit_test_facts:
- python_version
__cockpit_test_facts_subsets: "{{ ['!all', '!min'] +
__cockpit_test_facts }}"
setup:
gather_subset: "{{ __cockpit_test_facts_subsets }}"
when: __cockpit_test_facts |
difference(ansible_facts.keys() | list) | length > 0

- name: Flush handlers
meta: flush_handlers

Expand Down

0 comments on commit 93d416c

Please sign in to comment.