-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update log plugin to support more than one test case runs (#437)
Signed-off-by: Qi Zhang <qiz@vmware.com>
- Loading branch information
1 parent
82dd299
commit a5de6a5
Showing
14 changed files
with
799 additions
and
596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2023 VMware, Inc. | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
--- | ||
# Set current test case index, name and log folder | ||
# Parameters: | ||
# create_test_log_folder: True to create log folder for current test case. | ||
# test_log_folder_mode: The mode of log folder for current test case. Default is 0755. | ||
# | ||
# Supposing there are N test cases, | ||
# if N < 10, test cases will be 1 ~ N | ||
# if N >= 10, test cases will be 01 ~ N | ||
# so that test cases log folders are sorted | ||
- name: "Set current test case index and name" | ||
ansible.builtin.set_fact: | ||
current_testcase_index: "{{ '{:<}'.format(((current_testcase_index | default(0) | int + 1) | string). | ||
rjust(gosv_testcases_count | string | length, '0')) }}" | ||
current_testcase_name: "{{ ansible_play_name }}" | ||
|
||
- name: "Set the log folder path for current test case on local machine" | ||
ansible.builtin.set_fact: | ||
current_test_log_folder: "{{ testrun_log_path }}/{{ current_testcase_index }}_{{ ansible_play_name }}" | ||
|
||
- name: "Create log folder for current test case" | ||
include_tasks: create_directory.yml | ||
vars: | ||
dir_path: "{{ current_test_log_folder }}" | ||
dir_mode: "{{ test_log_folder_mode | default('0755') }}" | ||
when: | ||
- create_test_log_folder is defined | ||
- create_test_log_folder | bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.