Skip to content

Commit

Permalink
Move the ansible-test output_dir.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattclay committed Aug 29, 2019
1 parent d81ae27 commit 032bd3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/integration/targets/throttle/test_throttle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- hosts: localhosts
gather_facts: false
vars:
throttledir: ~/ansible_testing/throttle.dir/
throttledir: "{{ lookup('env', 'OUTPUT_DIR') }}/throttle.dir/"
tasks:
- name: Clean throttledir '{{ throttledir }}'
file:
Expand Down
2 changes: 1 addition & 1 deletion test/lib/ansible_test/_internal/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ def command_integration_filtered(args, targets, all_targets, inventory_path, pre

check_pyyaml(args, args.python_version)

test_dir = os.path.expanduser('~/ansible_testing')
test_dir = os.path.join(ResultType.TMP.path, 'output_dir')

if not args.explain and any('needs/ssh/' in target.aliases for target in targets):
max_tries = 20
Expand Down

0 comments on commit 032bd3a

Please sign in to comment.