public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Scott Mayhew <smayhew@redhat.com>
To: kdevops@lists.linux.dev
Subject: [PATCH 3/9] gitr: add last-run directory and last-kernel.txt to the results
Date: Mon,  3 Mar 2025 08:09:42 -0500	[thread overview]
Message-ID: <20250303130948.630029-4-smayhew@redhat.com> (raw)
In-Reply-To: <20250303130948.630029-1-smayhew@redhat.com>

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 <smayhew@redhat.com>
---
 playbooks/roles/gitr/tasks/main.yml | 59 +++++++++++++++++++++++++----
 1 file changed, 51 insertions(+), 8 deletions(-)

diff --git a/playbooks/roles/gitr/tasks/main.yml b/playbooks/roles/gitr/tasks/main.yml
index 42005d2..f1e7b6c 100644
--- a/playbooks/roles/gitr/tasks/main.yml
+++ b/playbooks/roles/gitr/tasks/main.yml
@@ -24,17 +24,43 @@
 - name: Set the pathname of the local results directory
   tags: vars
   ansible.builtin.set_fact:
-    gitr_results_dir: "../workflows/gitr/results/{{ ansible_kernel }}/{{ gitr_test_group }}/"
+    gitr_results_full_path: "{{ topdir_path }}/workflows/gitr/results"
+    gitr_results_target: "../workflows/gitr/results/last-run"
     gitr_run_uniqifier: "{{ ansible_date_time.iso8601_basic_short }}"
 
+- name: Clean up our localhost results/last-run directory
+  local_action: file path="{{ gitr_results_target }}/" state=absent
+  run_once: true
+  tags: [ 'run_tests', 'copy_results', 'clean_local_results' ]
+
+- name: Create empty last-run directory
+  local_action: file path="{{ gitr_results_target }}/" state=directory
+  run_once: true
+  tags: [ 'run_tests', 'copy_results', 'clean_local_results' ]
+
+- name: Get used target kernel version
+  tags: [ 'copy_results' ]
+  command: "uname -r"
+  register: uname_cmd
+
+- name: Store last kernel variable
+  tags: [ 'copy_results' ]
+  set_fact:
+    last_kernel: "{{ uname_cmd.stdout_lines | regex_replace('\\]') | regex_replace('\\[') | replace(\"'\",'') }}"
+  run_once: true
+
+- name: Document used target kernel version
+  local_action: "shell echo {{ last_kernel }} > {{ gitr_results_target }}/../last-kernel.txt"
+  tags: [ 'run_tests', 'copy_results', 'print_results' ]
+  run_once: true
+
 - name: Ensure the local results directory exists
   tags: copy_results
   ansible.builtin.file:
-    path: "{{ gitr_results_dir }}"
+    path: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}"
     state: directory
     mode: "u=rwx,g=rx,o=rx"
   delegate_to: localhost
-  run_once: true
 
 - name: Install dependencies for the git regression tests
   tags: gitr
@@ -303,7 +329,7 @@
   tags: copy_results
   ansible.builtin.fetch:
     src: "/tmp/{{ gitr_run_uniqifier }}.tgz"
-    dest: "{{ gitr_results_dir }}"
+    dest: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}/"
     flat: true
     validate_checksum: true
 
@@ -311,7 +337,7 @@
   tags: copy_results
   ansible.builtin.fetch:
     src: "{{ gitr_mnt }}/{{ gitr_run_uniqifier }}.summary"
-    dest: "{{ gitr_results_dir }}"
+    dest: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}/"
     flat: true
     validate_checksum: false
 
@@ -319,7 +345,7 @@
   tags: copy_results
   ansible.builtin.fetch:
     src: "{{ gitr_mnt }}/{{ gitr_run_uniqifier }}.stderr"
-    dest: "{{ gitr_results_dir }}"
+    dest: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}/"
     flat: true
     validate_checksum: false
   when: gitr_results.rc != 0
@@ -328,7 +354,7 @@
   tags: copy_results
   ansible.builtin.fetch:
     src: "{{ gitr_mnt }}/{{ gitr_run_uniqifier }}.rpc"
-    dest: "{{ gitr_results_dir }}"
+    dest: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}/"
     flat: true
     validate_checksum: false
   when:
@@ -339,9 +365,26 @@
   tags: copy_results
   ansible.builtin.fetch:
     src: "{{ gitr_mnt }}/{{ gitr_run_uniqifier }}.xprt"
-    dest: "{{ gitr_results_dir }}"
+    dest: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}/"
     flat: true
     validate_checksum: false
   when:
     - gitr_fstype == "nfs"
     - ansible_os_family == 'RedHat'
+
+- name: Verify last-run kernel directory exists
+  tags: [ 'copy_results' ]
+  delegate_to: localhost
+  stat:
+    path: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}"
+  register: last_run_kernel_dir
+
+- name: Copy over the last-run into the results directory for archiving into kdevops
+  copy:
+    src: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}"
+    dest: "{{ gitr_results_full_path }}/"
+  run_once: true
+  tags: [ 'copy_results' ]
+  delegate_to: localhost
+  when:
+    - last_run_kernel_dir.stat.exists
-- 
2.48.1


  parent reply	other threads:[~2025-03-03 13:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 13:09 [PATCH 0/9] tweak results organization and reporting Scott Mayhew
2025-03-03 13:09 ` [PATCH 1/9] pynfs: add last-run directory and last-kernel.txt to the results Scott Mayhew
2025-03-03 13:09 ` [PATCH 2/9] nfstest: " Scott Mayhew
2025-03-03 13:09 ` Scott Mayhew [this message]
2025-03-03 13:09 ` [PATCH 4/9] ltp: " Scott Mayhew
2025-03-03 13:09 ` [PATCH 5/9] fstests: add makefile target to show test results Scott Mayhew
2025-03-06 16:48   ` Luis Chamberlain
2025-03-03 13:09 ` [PATCH 6/9] pynfs: " Scott Mayhew
2025-03-03 13:09 ` [PATCH 7/9] nfstest: " Scott Mayhew
2025-03-03 13:09 ` [PATCH 8/9] gitr: " Scott Mayhew
2025-03-03 13:09 ` [PATCH 9/9] ltp: " Scott Mayhew
2025-03-12 20:09 ` [PATCH 0/9] tweak results organization and reporting Chuck Lever
2025-03-12 22:58   ` Luis Chamberlain
  -- strict thread matches above, loose matches on Subject: below --
2025-03-05  0:57 Scott Mayhew
2025-03-05  0:57 ` [PATCH 3/9] gitr: add last-run directory and last-kernel.txt to the results Scott Mayhew

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250303130948.630029-4-smayhew@redhat.com \
    --to=smayhew@redhat.com \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox