From nobody Fri May 17 00:06:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606400372; cv=none; d=zohomail.com; s=zohoarc; b=TuPcKS/5/mvsZP3SFLZGLMmmxNEVH3sQc5ZiW5aN43/UZagAUtFMTJPSa6oDMSbyF82OLZVelxAZDwLN8MlLduWjgEqjzX357AUOzjdH2hMXL5d0ZugEZ02p89ouv1Oh9Jag0QnlfX289Z1aEqhVMk4vtRU8NLWRKvjrwVedJdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606400372; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=B0+YfZ7+uxikagysWfIW2sy+6/9zHBrsfwyC6FCwXPc=; b=SOqyplgEykT3/obUz4g+bWNhB6ZZQJX65PfcFnHpVOVsOPFlsbtwTJuuENPhCYIMZJNivWsXLi6ChlcxDg9KDP2KgpV/8uWSkZL6DfQ7qczLtkhToNQUxCETdGY0BK8fhcN3XJtKSk4ChMJS1j9Cq4jIbWqrkqqqAyJdO1yVnNc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 16064003723601022.7328271497638; Thu, 26 Nov 2020 06:19:32 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-DJR1WvHVMTG655dmmQ3OcA-1; Thu, 26 Nov 2020 09:19:29 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6ADE11005D50; Thu, 26 Nov 2020 14:19:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBE9310013C0; Thu, 26 Nov 2020 14:19:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 44D0A1809C9F; Thu, 26 Nov 2020 14:19:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AQEJFUp010662 for ; Thu, 26 Nov 2020 09:19:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id DF3375D9D0; Thu, 26 Nov 2020 14:19:15 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-107.ams2.redhat.com [10.36.113.107]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61B665D9CC for ; Thu, 26 Nov 2020 14:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606400371; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=B0+YfZ7+uxikagysWfIW2sy+6/9zHBrsfwyC6FCwXPc=; b=Jhhi2rUs6GHgRoMuK55Zk+ZWb9SDLZLdOMB/Jfp72R+iXRk6bwTCahEO1k0MTE24U5lvEl yKwMThdWKbboXC2ct+WSlGDAtnc26PwZ2v3/WT2NlF0mXB4crGtS9sf/oxRy3hpOO+a4SY KHMyLRDb1INlTXM9FBzwsxNtIy7lGpE= X-MC-Unique: DJR1WvHVMTG655dmmQ3OcA-1 From: Paolo Bonzini To: libvir-list@redhat.com Subject: [PATCH v2] gitlab-ci: publish test report as an artifact Date: Thu, 26 Nov 2020 15:19:09 +0100 Message-Id: <20201126141909.394748-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Since version 0.55, "meson test" produces JUnit XML in the meson-logs directory. The XML can be parsed by GitLab and showed as part of the CI report. However, if the build and tests are performed by "meson dist", the tests are performed in "meson dist"'s own build directory and the logs are not accessible. So switch from "ninja dist" to "meson dist --no-tests" after a separate build step that is shared by the normal and the DIST=3Dskip cases. Signed-off-by: Paolo Bonzini --- v1->v2: only do it for new-enough distros For an example see https://gitlab.com/bonzini/libvirt/-/pipelines/221545357/test_report. Test durations however are not yet available in upstream Meson. --- .gitlab-ci.yml | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6792accf8f..c4b54201f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,36 @@ stages: <<: *container_job_definition allow_failure: true =20 +# For new enough distros that have Meson 0.55, include the JUnit XML +# report in the artifacts. In order to preserve it, we cannot use +# "meson dist" and need to do the compilation test manually. +# Fortunately, "meson dist --no-tests" was also added in Meson 0.55. +.native_meson055_build_job_template: &native_meson055_build_job_definition + stage: builds + image: $CI_REGISTRY_IMAGE/ci-$NAME:latest + cache: + paths: + - ccache/ + key: "$CI_JOB_NAME" + before_script: + - *script_variables + script: + - meson build --werror || (cat build/meson-logs/meson-log.txt && exit = 1) + - ninja -C build + - ninja -C build test + - DESTDIR=3D$PWD/install/ ninja -C build install + - meson dist -C build --no-tests + - if test -x /usr/bin/rpmbuild && test "$RPM" !=3D "skip"; + then + rpmbuild --nodeps -ta build/meson-dist/libvirt-*.tar.xz; + fi + artifacts: + when: always + paths: + - build/meson-logs/ + reports: + junit: build/meson-logs/testlog.junit.xml + .native_build_job_template: &native_build_job_definition stage: builds image: $CI_REGISTRY_IMAGE/ci-$NAME:latest @@ -292,7 +322,7 @@ x64-debian-10-clang: CC: clang =20 x64-debian-sid: - <<: *native_build_job_definition + <<: *native_meson055_build_job_definition needs: - x64-debian-sid-container variables: @@ -343,21 +373,21 @@ x64-fedora-31: RPM: skip =20 x64-fedora-32: - <<: *native_build_job_definition + <<: *native_meson055_build_job_definition needs: - x64-fedora-32-container variables: NAME: fedora-32 =20 x64-fedora-rawhide: - <<: *native_build_job_definition + <<: *native_meson055_build_job_definition needs: - x64-fedora-rawhide-container variables: NAME: fedora-rawhide =20 x64-fedora-rawhide-clang: - <<: *native_build_job_definition + <<: *native_meson055_build_job_definition needs: - x64-fedora-rawhide-container variables: --=20 2.28.0