Add new role "prepare_functional_tests_logs"

This new role will prepare archive with the logs from all
functional/fullstack tests. It will be more efficient to upload one
archive to swift after tests are done instead of uploading to Swift
many small files with logs from each test.

Change-Id: I4bb614778893caa7fb3519412a87196086420a21
This commit is contained in:
Slawek Kaplonski 2022-09-05 13:00:25 +02:00
parent ead685b938
commit 92dbc66135
5 changed files with 36 additions and 4 deletions

View File

@ -1,4 +1,5 @@
- hosts: all
roles:
- prepare_functional_tests_logs
- fetch-tox-output
- fetch-subunit-output

View File

@ -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.

View File

@ -0,0 +1,2 @@
logs_path: "/opt/stack/logs/dsvm-functional-logs"
log_archive_file_name: "/opt/stack/logs/dsvm-functional-logs.tar.gz"

View File

@ -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

View File

@ -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/.*$