From patchwork Mon Mar 3 13:09:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Mayhew X-Patchwork-Id: 13998811 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D841221128D for ; Mon, 3 Mar 2025 13:09:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741007395; cv=none; b=V1lAaS8cqNsfYyAThNhp/KO9Fy3cKelQtiz4Nhs3hy2ExDnzqdzx7tbbcqLbHkHiuaXWtoPPfoSD5mDxnz6RAgPC/P6TuNzSZ3K28Nifc+V3gc1S+JlO5D/czxltPiZkOgAl4yI7aMzb7V8Z4wKGyjg+/poIZmxnV2FVZGfpRB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741007395; c=relaxed/simple; bh=vEHWO5hpHEqVzurU3NnX5AJG69fbEOlOOgTSngzMEMg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=dbuAfvB7W55ibaDsIwYauIPpX8BdzX2NGp+L0o6LrJs4Pswq19H8zwxd2QMtLJc6t20Zq05y47oDGz5FKXb6uycJyXIeC889tpjmggR9DwKXmdXWfJyMoV/nE/P3deohGY7j9t1LQCfNTi7dje/BRhC/Na7x4g2iv+nuSh6rHlE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=eBzFUBnb; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eBzFUBnb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741007392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3S0hdtmwe1LIrZXsM+oVYlfiYp3NsVMkM3D0s/kmxOU=; b=eBzFUBnbpMH8p9TKHU1VYphGNpRi2Ub0hX/xLOW4MaYJvmpBOFBNDPHAaZu608WfecyQAn DNVX4RnLQZEQEDrCxaSSwTUMfbQkryjwvdTTAcN9PIOUs1mibSWQBzYQd+wTYw07NHD5kH HApNypYSyWmqfWn8sF+vajK9eYljC2M= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-578-MD0KcsATM2uaiFh8nfKy6w-1; Mon, 03 Mar 2025 08:09:51 -0500 X-MC-Unique: MD0KcsATM2uaiFh8nfKy6w-1 X-Mimecast-MFC-AGG-ID: MD0KcsATM2uaiFh8nfKy6w_1741007390 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C7466180099D for ; Mon, 3 Mar 2025 13:09:50 +0000 (UTC) Received: from aion.redhat.com (unknown [10.22.64.10]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7499E1956048 for ; Mon, 3 Mar 2025 13:09:50 +0000 (UTC) Received: from aion.redhat.com (localhost [IPv6:::1]) by aion.redhat.com (Postfix) with ESMTP id DA6FF336C24 for ; Mon, 03 Mar 2025 08:09:48 -0500 (EST) From: Scott Mayhew 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 Message-ID: <20250303130948.630029-4-smayhew@redhat.com> In-Reply-To: <20250303130948.630029-1-smayhew@redhat.com> References: <20250303130948.630029-1-smayhew@redhat.com> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 3nxxYGlztx1Vc0W5c0Ov17GMqB-OQcwyLEZFHd8pIDM_1741007390 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true 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 --- 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