Merge "Enable tempest cleanup with record_resources in jobs"

This commit is contained in:
Zuul 2024-05-21 14:21:17 +00:00 committed by Gerrit Code Review
commit de60d34499
5 changed files with 52 additions and 3 deletions

View File

@ -47,6 +47,15 @@ saved_state.json file.
only resources with names that match the prefix. This option can be used
together with dry_run.
.. zuul:rolevar:: run_tempest_cleanup_resource_list
:default: false
When true, tempest cleanup will be called with '--resource-list' to delete
only resources listed in ./resource_list.json that is created if
record_resources config option in the default section of tempest.conf file
is enabled (set to True). The resource_list.json contains all resources
created by Tempest during a Tempest run.
Role usage
----------

View File

@ -3,3 +3,4 @@ init_saved_state: false
dry_run: false
run_tempest_fail_if_leaked_resources: false
run_tempest_cleanup_prefix: false
run_tempest_cleanup_resource_list: false

View File

@ -5,7 +5,9 @@
command: tox -evenv-tempest -- tempest cleanup --dry-run --debug
args:
chdir: "{{ devstack_base_dir }}/tempest"
when: not run_tempest_cleanup_prefix
when:
- not run_tempest_cleanup_prefix
- run_tempest_cleanup_resource_list is not defined or not run_tempest_cleanup_resource_list
- name: Run tempest cleanup dry-run with tempest prefix
become: yes
@ -14,3 +16,11 @@
args:
chdir: "{{ devstack_base_dir }}/tempest"
when: run_tempest_cleanup_prefix
- name: Run tempest cleanup with tempest resource list
become: yes
become_user: tempest
command: tox -evenv-tempest -- tempest cleanup --dry-run --debug --resource-list
args:
chdir: "{{ devstack_base_dir }}/tempest"
when: run_tempest_cleanup_resource_list

View File

@ -27,7 +27,9 @@
command: tox -evenv-tempest -- tempest cleanup --debug
args:
chdir: "{{ devstack_base_dir }}/tempest"
when: not run_tempest_cleanup_prefix
when:
- not run_tempest_cleanup_prefix
- run_tempest_cleanup_resource_list is not defined or not run_tempest_cleanup_resource_list
- name: Run tempest cleanup with tempest prefix
become: yes
@ -37,6 +39,18 @@
chdir: "{{ devstack_base_dir }}/tempest"
when: run_tempest_cleanup_prefix
- name: Cat resource_list.json
command: cat "{{ devstack_base_dir }}/tempest/resource_list.json"
when: run_tempest_cleanup_resource_list
- name: Run tempest cleanup with tempest resource list
become: yes
become_user: tempest
command: tox -evenv-tempest -- tempest cleanup --debug --resource-list
args:
chdir: "{{ devstack_base_dir }}/tempest"
when: run_tempest_cleanup_resource_list
- when:
- run_tempest_fail_if_leaked_resources
- not init_saved_state

View File

@ -17,6 +17,13 @@
# TODO(gmann): Enable File injection tests once nova bug is fixed
# https://bugs.launchpad.net/nova/+bug/1882421
# ENABLE_FILE_INJECTION: true
run_tempest_cleanup: true
run_tempest_cleanup_resource_list: true
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
DEFAULT:
record_resources: true
- job:
name: tempest-ipv6-only
@ -37,6 +44,14 @@
tools/tempest-extra-tests-list.txt.
vars:
tox_envlist: extra-tests
run_tempest_cleanup: true
run_tempest_cleanup_resource_list: true
run_tempest_dry_cleanup: true
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
DEFAULT:
record_resources: true
- job:
name: tempest-full-py3