#5 do not remove package from atomic and run inventory.yml when has classic tag
Merged 6 years ago by astepano. Opened 6 years ago by bgoncalv.
rpms/ bgoncalv/standard-test-roles fix-tests-atomic  into  master

file modified
+3
@@ -1,4 +1,6 @@ 

  - hosts: localhost

+   tags:

+     - always

    tasks:

      - name: Get inventory with empty input

        command: merge-standard-inventory
@@ -6,6 +8,7 @@ 

          # Reset vars to default values

          TEST_SUBJECTS:

        register: inventory

+       delegate_to: localhost

      - name: Assert merge-standard-inventory produces correct JSON inventory (list)

        fail:

        when: inventory.stdout|from_json|json_query('subjects.hosts')|type_debug != 'list'

@@ -1,3 +1,7 @@ 

+ - include_role:

+     name: str-common

+     tasks_from: inspect.yml

This task sets some ansible fact. What facts do we need?

we need is_atomic as we should not try to remove package if it is atomic.

Ok. Thank you for explanation.

+ 

  - set_fact:

      req_pkg: zsh

  
@@ -5,3 +9,4 @@ 

    package:

      name: "{{req_pkg}}"

      state: absent

+   when: not is_atomic

no initial comment

No need.
Please inspect tests/inventory.yml file. This file does not include any role.
This tag is redundant.
This tag will rise questions: why it stays there.

This task sets some ansible fact. What facts do we need?

we need is_atomic as we should not try to remove package if it is atomic.

It seem we need to define the tag there, otherwise the tasks did not run when I run the tests using classic tag.

Ok. Thank you for explanation.

rebased onto fa65733

6 years ago

Pull-Request has been merged by astepano

6 years ago