From 032bd3a030c5f0c08dc52f5467d52dce97ee1933 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 29 Aug 2019 01:21:38 -0700 Subject: [PATCH] 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. --- test/integration/targets/throttle/test_throttle.yml | 2 +- test/lib/ansible_test/_internal/executor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/targets/throttle/test_throttle.yml b/test/integration/targets/throttle/test_throttle.yml index 260ebcdc03f..a2993ddc6cf 100644 --- a/test/integration/targets/throttle/test_throttle.yml +++ b/test/integration/targets/throttle/test_throttle.yml @@ -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: diff --git a/test/lib/ansible_test/_internal/executor.py b/test/lib/ansible_test/_internal/executor.py index d02b30f92c1..3de843d6123 100644 --- a/test/lib/ansible_test/_internal/executor.py +++ b/test/lib/ansible_test/_internal/executor.py @@ -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