Skip to content

Commit

Permalink
update live test
Browse files Browse the repository at this point in the history
  • Loading branch information
pb82 committed Feb 7, 2025
1 parent a125a57 commit 4da7e1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions awx/main/tests/live/tests/test_indirect_host_counting.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def test_indirect_host_counting(live_tmp_folder, run_job_from_playbook):
job = Job.objects.filter(name__icontains='test_indirect_host_counting').order_by('-created').first()
wait_for_events(job) # We must wait for events because system tasks iterate on job.job_events.filter(...)

# Data matches to awx/main/tests/data/projects/host_query/meta/event_query.yml
# Data matches to awx/main/tests/data/projects/host_query/extensions/audit/event_query.yml
# this just does things in-line to be a more localized test for the immediate testing
module_jq_str = '{canonical_facts: {host_name: .direct_host_name}, facts: {device_type: .device_type}}'
event_query = {'demo.query.example': module_jq_str}
event_query = {'demo.query.example': {'query': module_jq_str}}

# Run the task logic directly with local data
results = build_indirect_host_data(job, event_query)
Expand All @@ -34,7 +34,7 @@ def test_indirect_host_counting(live_tmp_folder, run_job_from_playbook):
assert 'host_query' in job.installed_collections['demo.query']
hq_text = job.installed_collections['demo.query']['host_query']
hq_data = yaml.safe_load(hq_text)
assert hq_data == {'demo.query.example': module_jq_str}
assert hq_data == {'demo.query.example': {'query': module_jq_str}}

assert job.ansible_version

Expand Down

0 comments on commit 4da7e1d

Please sign in to comment.