Skip to content

Commit f0c8372

Browse files
committed
pynfs: add last-run directory and last-kernel.txt to the results
Create the last-run directory and last-kernel.txt file in a manner similar to the way the fstests workflow does it. This will make it easier to get at the most recent test results for reporting purposes. Signed-off-by: Scott Mayhew <[email protected]>
1 parent 1bdc2ac commit f0c8372

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

playbooks/roles/pynfs/tasks/main.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
- name: Set the path where we collect our local pynfs results
1313
set_fact:
1414
pynfs_workflow_dir: "../workflows/pynfs"
15+
pynfs_results_full_path: "{{ topdir_path }}/workflows/pynfs/results"
16+
pynfs_results_target: "../workflows/pynfs/results/last-run/"
1517
tags: [ 'vars' ]
1618

1719
- name: Clean up our localhost results directory and files
@@ -127,6 +129,16 @@
127129
delay: 1
128130
until: result.rc == 0
129131

132+
- name: Clean up our localhost results/last-run directory
133+
local_action: file path="{{ pynfs_results_target }}/" state=absent
134+
run_once: true
135+
tags: [ 'run_tests', 'copy_results', 'clean_local_results' ]
136+
137+
- name: Create empty last-run directory
138+
local_action: file path="{{ pynfs_results_target }}/" state=directory
139+
run_once: true
140+
tags: [ 'run_tests', 'copy_results', 'clean_local_results' ]
141+
130142
- name: Run pynfs
131143
tags: [ 'run_tests' ]
132144
script: "{{ pynfs_workflow_dir }}/scripts/run_pynfs.sh"
@@ -156,14 +168,19 @@
156168
kernel_rev: "{{ uname_cmd.stdout_lines | regex_replace('\\]') | regex_replace('\\[') | replace(\"'\",'') }}"
157169
run_once: true
158170

171+
- name: Document used target kernel version
172+
local_action: "shell echo {{ kernel_rev }} > {{ pynfs_results_target }}/../last-kernel.txt"
173+
tags: [ 'run_tests', 'copy_results', 'print_results' ]
174+
run_once: true
175+
159176
- name: Copy the version-specific results to the control node
160177
tags: [ 'copy_results' ]
161178
become: yes
162179
become_flags: 'su - -c'
163180
become_method: sudo
164181
fetch:
165182
src: "{{ pynfs_data }}/pynfs-{{ item }}-results.json"
166-
dest: "{{ pynfs_workflow_dir }}/results/{{ kernel_rev }}-v{{ item }}.json"
183+
dest: "{{ pynfs_results_full_path }}/last-run/{{ kernel_rev}}/{{ kernel_rev }}-v{{ item }}.json"
167184
flat: yes
168185
with_items:
169186
- 4.0
@@ -176,9 +193,26 @@
176193
become_method: ansible.builtin.sudo
177194
fetch:
178195
src: "{{ pynfs_data }}/pynfs-{{ item }}-results.json"
179-
dest: "{{ pynfs_workflow_dir }}/results/{{ kernel_rev }}-v{{ item }}.json"
196+
dest: "{{ pynfs_results_full_path }}/last-run/{{ kernel_rev}}/{{ kernel_rev }}-v{{ item }}.json"
180197
flat: true
181198
with_items:
182199
- block
183200
when:
184201
- pynfs_pnfs_block|bool
202+
203+
- name: Verify last-run kernel directory exists
204+
tags: [ 'copy_results' ]
205+
delegate_to: localhost
206+
stat:
207+
path: "{{ pynfs_results_full_path }}/last-run/{{ kernel_rev }}"
208+
register: last_run_kernel_dir
209+
210+
- name: Copy over the last-run into the results directory for archiving into kdevops
211+
copy:
212+
src: "{{ pynfs_results_full_path }}/last-run/{{ kernel_rev }}"
213+
dest: "{{ pynfs_results_full_path }}/"
214+
run_once: true
215+
tags: [ 'copy_results' ]
216+
delegate_to: localhost
217+
when:
218+
- last_run_kernel_dir.stat.exists

0 commit comments

Comments
 (0)