From e5dc872f094ae13cf99c9bad16f88becd18ef65f Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 7 Dec 2022 13:53:23 -0800 Subject: [PATCH] Move tox logs into env specific dirs New tox>=4 does not prefix the filenames with the env name. THis means we'll squash together log files if more than one env is run. Address this while on tox v3 to avoid regressions. Change-Id: I2601cc7faa1f7a5d7f2d950d637dfa84c50717ae --- roles/fetch-tox-output/tasks/main.yaml | 4 ++-- test-playbooks/python/fetch-tox-output.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/fetch-tox-output/tasks/main.yaml b/roles/fetch-tox-output/tasks/main.yaml index 1ef72acbb..4e2747870 100644 --- a/roles/fetch-tox-output/tasks/main.yaml +++ b/roles/fetch-tox-output/tasks/main.yaml @@ -64,7 +64,7 @@ - name: Copy tox logs # noqa risky-file-permissions copy: - dest: "{{ zuul_output_dir }}/logs/tox/" + dest: "{{ zuul_output_dir }}/logs/tox/{{ zj_testenv }}/" src: "{{ zuul_work_dir }}/.tox/{{ zj_testenv }}/log/" remote_src: true loop: "{{ envlist }}" @@ -77,7 +77,7 @@ - name: Collect tox logs synchronize: - dest: "{{ log_path }}" + dest: "{{ log_path }}/{{ zj_testenv }}" mode: pull src: "{{ zuul_work_dir }}/.tox/{{ zj_testenv }}/log/" verify_host: true diff --git a/test-playbooks/python/fetch-tox-output.yaml b/test-playbooks/python/fetch-tox-output.yaml index 3c3d3bfb1..537e8ba9f 100644 --- a/test-playbooks/python/fetch-tox-output.yaml +++ b/test-playbooks/python/fetch-tox-output.yaml @@ -56,14 +56,14 @@ post_tasks: - name: Check for artifact on the test instance stat: - path: "{{ ansible_user_dir }}/zuul-output/logs/tox/venv-0.log" + path: "{{ ansible_user_dir }}/zuul-output/logs/tox/venv/venv-0.log" register: _test_artifact failed_when: not _test_artifact.stat.exists when: zuul_use_fetch_output - name: Check for artifact on the executor stat: - path: "{{ zuul.executor.log_root }}/tox/venv-0.log" + path: "{{ zuul.executor.log_root }}/tox/venv/venv-0.log" delegate_to: localhost register: _executor_artifact failed_when: not _executor_artifact.stat.exists