public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Andrew Jones <andrew.jones@linux.dev>,
	Janosch Frank <frankja@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Nico Boehr <nrb@linux.ibm.com>
Subject: [kvm-unit-tests PATCH] ci: Provide the logs as artifacts
Date: Mon,  3 Apr 2023 11:32:55 +0200	[thread overview]
Message-ID: <20230403093255.45104-1-thuth@redhat.com> (raw)

If something goes wrong, it's good to have a way to see where it failed,
so let's provide the logs as artifacts.

While we're at it, also dump /proc/cpuinfo in the Fedora KVM job
as this might contain valuable information about the KVM environment.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml                | 22 ++++++++++++++++++++++
 ci/cirrus-ci-fedora.yml       |  6 ++++++
 ci/cirrus-ci-macos-i386.yml   |  4 ++++
 ci/cirrus-ci-macos-x86-64.yml |  4 ++++
 4 files changed, 36 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ad7949c9..59a3d3c8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,7 +4,20 @@ before_script:
  - dnf update -y
  - dnf install -y make python
 
+.intree_template:
+ artifacts:
+  expire_in: 2 days
+  paths:
+   - logs
+
+.outoftree_template:
+ artifacts:
+  expire_in: 2 days
+  paths:
+   - build/logs
+
 build-aarch64:
+ extends: .intree_template
  script:
  - dnf install -y qemu-system-aarch64 gcc-aarch64-linux-gnu
  - ./configure --arch=aarch64 --cross-prefix=aarch64-linux-gnu-
@@ -35,6 +48,7 @@ build-aarch64:
  - if grep -q FAIL results.txt ; then exit 1 ; fi
 
 build-arm:
+ extends: .outoftree_template
  script:
  - dnf install -y qemu-system-arm gcc-arm-linux-gnu
  - mkdir build
@@ -49,6 +63,7 @@ build-arm:
  - if grep -q FAIL results.txt ; then exit 1 ; fi
 
 build-ppc64be:
+ extends: .outoftree_template
  script:
  - dnf install -y qemu-system-ppc gcc-powerpc64-linux-gnu
  - mkdir build
@@ -62,6 +77,7 @@ build-ppc64be:
  - if grep -q FAIL results.txt ; then exit 1 ; fi
 
 build-ppc64le:
+ extends: .intree_template
  script:
  - dnf install -y qemu-system-ppc gcc-powerpc64-linux-gnu
  - ./configure --arch=ppc64 --endian=little --cross-prefix=powerpc64-linux-gnu-
@@ -73,6 +89,7 @@ build-ppc64le:
  - if grep -q FAIL results.txt ; then exit 1 ; fi
 
 build-s390x:
+ extends: .outoftree_template
  script:
  - dnf install -y qemu-system-s390x gcc-s390x-linux-gnu
  - mkdir build
@@ -109,6 +126,7 @@ build-s390x:
  - if grep -q FAIL results.txt ; then exit 1 ; fi
 
 build-x86_64:
+ extends: .intree_template
  script:
  - dnf install -y qemu-system-x86 gcc
  - ./configure --arch=x86_64
@@ -147,6 +165,7 @@ build-x86_64:
  - if grep -q FAIL results.txt ; then exit 1 ; fi
 
 build-i386:
+ extends: .outoftree_template
  script:
  - dnf install -y qemu-system-x86 gcc
  - mkdir build
@@ -180,6 +199,7 @@ build-i386:
  - if grep -q FAIL results.txt ; then exit 1 ; fi
 
 build-clang:
+ extends: .intree_template
  script:
  - dnf install -y qemu-system-x86 clang
  - ./configure --arch=x86_64 --cc=clang
@@ -218,6 +238,7 @@ build-clang:
  - grep -q PASS results.txt && ! grep -q FAIL results.txt
 
 build-centos7:
+ extends: .outoftree_template
  image: centos:7
  before_script:
  - yum update -y
@@ -266,6 +287,7 @@ cirrus-ci-macos-x86-64:
  <<: *cirrus_build_job_definition
 
 s390x-kvm:
+ extends: .intree_template
  before_script: []
  tags:
   - s390x-z15-vm
diff --git a/ci/cirrus-ci-fedora.yml b/ci/cirrus-ci-fedora.yml
index d6070f70..918c9a36 100644
--- a/ci/cirrus-ci-fedora.yml
+++ b/ci/cirrus-ci-fedora.yml
@@ -13,6 +13,8 @@ fedora_task:
     - git fetch origin "@CI_COMMIT_REF_NAME@"
     - git reset --hard "@CI_COMMIT_SHA@"
   script:
+    - uname -r
+    - sed -n "/processor.*:.0/,/^$/p" /proc/cpuinfo
     - mkdir build
     - cd build
     - ../configure
@@ -70,3 +72,7 @@ fedora_task:
         xsave
         | tee results.txt
     - grep -q PASS results.txt && ! grep -q FAIL results.txt
+  on_failure:
+    log_artifacts:
+      path: build/logs/*.log
+      type: text/plain
diff --git a/ci/cirrus-ci-macos-i386.yml b/ci/cirrus-ci-macos-i386.yml
index ed580e61..45d1b716 100644
--- a/ci/cirrus-ci-macos-i386.yml
+++ b/ci/cirrus-ci-macos-i386.yml
@@ -35,3 +35,7 @@ macos_i386_task:
          vmexit_tscdeadline_immed
          | tee results.txt
     - grep -q PASS results.txt && ! grep -q FAIL results.txt
+  on_failure:
+    log_artifacts:
+      path: build/logs/*.log
+      type: text/plain
diff --git a/ci/cirrus-ci-macos-x86-64.yml b/ci/cirrus-ci-macos-x86-64.yml
index 861caa16..8ee6fb7e 100644
--- a/ci/cirrus-ci-macos-x86-64.yml
+++ b/ci/cirrus-ci-macos-x86-64.yml
@@ -39,3 +39,7 @@ macos_task:
          vmexit_tscdeadline_immed
          | tee results.txt
     - grep -q PASS results.txt && ! grep -q FAIL results.txt
+  on_failure:
+    log_artifacts:
+      path: build/logs/*.log
+      type: text/plain
-- 
2.31.1


             reply	other threads:[~2023-04-03  9:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03  9:32 Thomas Huth [this message]
2023-04-03 10:56 ` [kvm-unit-tests PATCH] ci: Provide the logs as artifacts Claudio Imbrenda

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=20230403093255.45104-1-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=andrew.jones@linux.dev \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    /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