From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 197241382C5 for ; Sat, 29 May 2021 15:15:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 645E9E0788; Sat, 29 May 2021 15:15:49 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4B0B6E0788 for ; Sat, 29 May 2021 15:15:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 51BF5335C7E for ; Sat, 29 May 2021 15:15:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BD36C790 for ; Sat, 29 May 2021 15:15:45 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1622301343.4bfa549af9709682d530782d068d72c43a709e62.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: metadata/install-qa-check.d/ X-VCS-Repository: repo/gentoo X-VCS-Files: metadata/install-qa-check.d/60python-tests X-VCS-Directories: metadata/install-qa-check.d/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 4bfa549af9709682d530782d068d72c43a709e62 X-VCS-Branch: master Date: Sat, 29 May 2021 15:15:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 458bd175-7f6a-4f75-8ceb-2b9d5f22bb86 X-Archives-Hash: b15c21bf4212976787c33447a06caf77 commit: 4bfa549af9709682d530782d068d72c43a709e62 Author: Michał Górny gentoo org> AuthorDate: Sat May 29 11:45:45 2021 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat May 29 15:15:43 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bfa549a install-qa-check.d: Check for missing tests in distutils-r1 ebuilds Signed-off-by: Michał Górny gentoo.org> metadata/install-qa-check.d/60python-tests | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/metadata/install-qa-check.d/60python-tests b/metadata/install-qa-check.d/60python-tests new file mode 100644 index 00000000000..713ed63d376 --- /dev/null +++ b/metadata/install-qa-check.d/60python-tests @@ -0,0 +1,32 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# QA check: ensure that tests are run if present +# Maintainer: Python project + +python_test_check() { + # only distutils-r1 is covered for the time being + has distutils-r1 ${INHERITED} || return + # skip packages that define tests + declare -p -f python_test &>/dev/null && return + # skip packages that explicitly restrict tests + has test ${RESTRICT} && return + + # do we have any files looking like tests? + local any=$(find "${WORKDIR}" -name 'test_*.py' -print -quit) + [[ -n ${any} ]] || return + + eqawarn + eqawarn 'QA Notice: this package seems to contain tests but they are not enabled.' + eqawarn 'Please either run tests (via distutils_enable_tests or declaring' + eqawarn 'python_test yourself), or add RESTRICT="test" along with an explanatory' + eqawarn 'comment if tests cannot be run.' + eqawarn + eqatag -v python-tests.missing +} + +python_test_check + +: # guarantee successful exit + +# vim:ft=ebuild