ansible/test/integration/targets/throttle/test_throttle.yml
Matt Clay 032bd3a030 Move the ansible-test output_dir.
This directory is currently a fixed location to make troubleshooting easier.
It is cleared before each test target runs, but is preserved when a test target finishes.
This allows the contents to be inspected when a test fails.

The previous location was `~/ansible_testing/`.
The new location is within the content root:

- `test/results/.tmp/output_dir` for Ansible
- `tests/output/.tmp/output_dir` for Ansible Collections

Moving the directory reduces the number of places on the filesystem where tests create output.
It also enables the results to be returned from delegated systems.
2019-08-29 02:32:31 -07:00

59 lines
1.8 KiB
YAML

---
- hosts: localhosts
gather_facts: false
vars:
throttledir: "{{ lookup('env', 'OUTPUT_DIR') }}/throttle.dir/"
tasks:
- name: Clean throttledir '{{ throttledir }}'
file:
state: absent
path: '{{ throttledir }}'
ignore_errors: yes
run_once: yes
- name: Create throttledir '{{ throttledir }}'
file:
state: directory
path: '{{ throttledir }}'
run_once: yes
- block:
- name: "Test 1 (max throttle: 3)"
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 3"
throttle: 3
- block:
- name: "Test 2 (max throttle: 5)"
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 5"
throttle: 5
- block:
- name: "Test 3 (max throttle: 8)"
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 8"
throttle: 8
throttle: 6
- block:
- block:
- name: "Test 4 (max throttle: 8)"
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 8"
throttle: 8
throttle: 6
throttle: 12
throttle: 15
- block:
- name: "Test 1 (max throttle: 3)"
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 3"
throttle: 3
- block:
- name: "Test 2 (max throttle: 5)"
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 5"
throttle: 5
- block:
- name: "Test 3 (max throttle: 6)"
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 6"
throttle: 6
throttle: 3
- block:
- block:
- name: "Test 4 (max throttle: 8)"
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 8"
throttle: 8
throttle: 6
throttle: 4
throttle: 2