diff --git a/playbooks/post_functional_job.yaml b/playbooks/post_functional_job.yaml index 7f0cb198245..1e81a1b0616 100644 --- a/playbooks/post_functional_job.yaml +++ b/playbooks/post_functional_job.yaml @@ -1,4 +1,5 @@ - hosts: all roles: + - prepare_functional_tests_logs - fetch-tox-output - fetch-subunit-output diff --git a/roles/prepare_functional_tests_logs/README.rst b/roles/prepare_functional_tests_logs/README.rst new file mode 100644 index 00000000000..db19658a624 --- /dev/null +++ b/roles/prepare_functional_tests_logs/README.rst @@ -0,0 +1,14 @@ +Prepare archive with the tests' logs + +**Role Variables** + +.. zuul:rolevar:: logs_path + :default: /opt/stack/logs/dsvm-functional-logs + + Path where logs from the tests are stored on job's node. + +.. zuul:rolevar:: log_archive_file_name + :default: /opt/stack/logs/dsvm-functional-logs.tar.gz + + Name of archive with the logs. + diff --git a/roles/prepare_functional_tests_logs/defaults/main.yaml b/roles/prepare_functional_tests_logs/defaults/main.yaml new file mode 100644 index 00000000000..ea72b3f1997 --- /dev/null +++ b/roles/prepare_functional_tests_logs/defaults/main.yaml @@ -0,0 +1,2 @@ +logs_path: "/opt/stack/logs/dsvm-functional-logs" +log_archive_file_name: "/opt/stack/logs/dsvm-functional-logs.tar.gz" diff --git a/roles/prepare_functional_tests_logs/tasks/main.yaml b/roles/prepare_functional_tests_logs/tasks/main.yaml new file mode 100644 index 00000000000..1f65d87402a --- /dev/null +++ b/roles/prepare_functional_tests_logs/tasks/main.yaml @@ -0,0 +1,13 @@ +- name: Prepare logs archive {{ log_archive_file_name }} + become: yes + shell: + cmd: | + /usr/bin/tar -czf {{ log_archive_file_name }} {{ logs_path }} + +- name: Set {{ log_archive_file_name }} ownership + become: yes + file: + path: "{{ log_archive_file_name }}" + owner: "{{ ansible_user }}" + group: "{{ ansible_user }}" + mode: 0775 diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index 8bbab623795..e415f24c930 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -50,10 +50,10 @@ tox_envlist: dsvm-functional-gate tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/openstack/requirements/upper-constraints.txt' zuul_copy_output: - # We need to copy directory with logs to have it in job artifacts also, + # We need to copy archive with logs to have it in job artifacts also, # /opt/stack/logs is default logs directory defined in neutron's # tox.ini file - '{{ devstack_base_dir }}/logs/dsvm-functional-logs': logs + '/opt/stack/logs/dsvm-functional-logs.tar.gz': logs - job: name: neutron-fullstack @@ -62,11 +62,13 @@ tox_envlist: dsvm-fullstack-gate Q_BUILD_OVS_FROM_GIT: False INSTALL_OVN: False + logs_path: '/opt/stack/logs/dsvm-fullstack-logs' + log_archive_file_name: '/opt/stack/logs/dsvm-fullstack-logs.tar.gz' zuul_copy_output: - # We need to copy directory with logs to have it in job artifacts also, + # We need to copy archive with logs to have it in job artifacts also, # /opt/stack/logs is default logs directory defined in neutron's # tox.ini file - '{{ devstack_base_dir }}/logs/dsvm-fullstack-logs': logs + '/opt/stack/logs/dsvm-fullstack-logs.tar.gz': logs irrelevant-files: - ^releasenotes/.*$ - ^doc/.*$