Skip to content

Commit

Permalink
Merge pull request #404 from sean-m-sullivan/suite_md_update
Browse files Browse the repository at this point in the history
Update tests
  • Loading branch information
djdanielsson authored Nov 1, 2022
2 parents 3f2e373 + 66f5893 commit cc24572
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
# types:
# - yaml
- repo: 'https://github.com/ansible-community/ansible-lint.git'
rev: v6.8.2
rev: v6.8.4
hooks:
# see discussions here about what arguments are used, and behavior
# https://github.com/ansible/ansible-lint/issues/649
Expand All @@ -34,7 +34,7 @@ repos:
hooks:
- id: markdownlint-cli2
- repo: https://github.com/ambv/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black
name: black
Expand Down
2 changes: 2 additions & 0 deletions examples/configs/inventory_sources.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
controller_configuration_inventory_source_update_async_retries: 60
controller_configuration_inventory_source_update_async_delay: 2
controller_inventory_sources:
- name: RHVM-01
source: scm
Expand Down
2 changes: 2 additions & 0 deletions examples/configs/projects.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
controller_configuration_projects_async_retries: 60
controller_configuration_projects_async_delay: 2
controller_projects:
- name: Test Project
scm_type: git
Expand Down
2 changes: 2 additions & 0 deletions examples/configs_export_model/projects_export.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
controller_configuration_projects_async_retries: 60
controller_configuration_projects_async_delay: 2
controller_projects:
- name: Tower Config Testing
description: ''
Expand Down
4 changes: 2 additions & 2 deletions examples/configure_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@

- name: "Error out on empty list"
ansible.builtin.set_fact:
error_empty_diff: "{{ lookup('controller_object_diff', api_list=controller_api_results, compare_list=differential_test_items, warn_on_empty_api=false) }}"
error_empty_diff: "{{ lookup('redhat_cop.controller_configuration.controller_object_diff', api_list=controller_api_results, compare_list=differential_test_items, warn_on_empty_api=false) }}"
ignore_errors: true
register: error_results

- name: "Warn out on empty list"
ansible.builtin.set_fact:
warn_empty_diff: "{{ lookup('controller_object_diff', api_list=controller_api_results, compare_list=differential_test_items) }}"
warn_empty_diff: "{{ lookup('redhat_cop.controller_configuration.controller_object_diff', api_list=controller_api_results, compare_list=differential_test_items) }}"
register: warn_results

- name: "Assert that the empty list error correctly"
Expand Down
8 changes: 6 additions & 2 deletions examples/tasks/differential.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
---
- name: "Get the API list in the Default Organization of all {{ differential_item.name }}"
ansible.builtin.set_fact:
controller_api_results: "{{ lookup('awx.awx.controller_object_diff', differential_item.name, query_params={'organization': controller_organization_id.id}, host=controller_hostname, username=controller_username, password=controller_password, verify_ssl=false) }}"
controller_api_results: "{{ lookup(controller_api_plugin, differential_item.name, query_params={'organization': controller_organization_id.id}, host=controller_hostname, username=controller_username, password=controller_password, verify_ssl=false) }}"

- name: "Find the difference between what is on the Controller versus curated list of {{ differential_item.name }}"
ansible.builtin.set_fact:
set_absent_diff: "{{ lookup('awx.awx.controller_object_diff', api_list=controller_api_results, compare_list=differential_item.differential_test_items, with_present=differential_item.with_present) }}"
set_absent_diff: "{{ lookup('redhat_cop.controller_configuration.controller_object_diff', api_list=controller_api_results, compare_list=differential_item.differential_test_items, with_present=differential_item.with_present) }}"

- name: Display set_absent_diff
ansible.builtin.debug:
var: set_absent_diff

- name: Display differential_item.expected_test_result
ansible.builtin.debug:
var: differential_item.expected_test_result

- name: "Assert that the expected results match for {{ differential_item.name }}"
ansible.builtin.assert:
that:
Expand Down

0 comments on commit cc24572

Please sign in to comment.