Tooling for running collection tests locally ad hoc (#14160)

This commit is contained in:
Alan Rominger
2023-06-22 13:32:09 -04:00
committed by GitHub
parent 66f14bfe8f
commit aa8437fd77
2 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
---
- hosts: localhost
gather_facts: false
connection: local
collections:
- awx.awx
vars:
collection_location: "{{ playbook_dir }}/.."
loc_tests: "{{ collection_location }}/tests/integration/targets/"
test: ad_hoc_command,host,role
tasks:
- name: DEBUG - make sure variables are what we expect
debug:
msg: |
Running tests at location:
{{ loc_tests }}
Running tests folders:
{{ test | trim | split(',') }}
- name: "Include test targets"
include_tasks: "{{ loc_tests }}{{ test_name }}/tasks/main.yml"
loop: "{{ test | trim | split(',') }}"
loop_control:
loop_var: test_name