public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jitka Plesnikova <jplesnik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/perl-Sys-Virt] epel10.2: Package tests
Date: Tue, 30 Jun 2026 07:31:38 GMT [thread overview]
Message-ID: <178280469824.1.768764923414603749.rpms-perl-Sys-Virt-f1f7d500d12d@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/perl-Sys-Virt
Branch : epel10.2
Commit : f1f7d500d12d1ce922e496ec0f6788c1b295ed99
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date : 2021-03-02T11:12:37+01:00
Stats : +60/-5 in 5 file(s)
URL : https://src.fedoraproject.org/rpms/perl-Sys-Virt/c/f1f7d500d12d1ce922e496ec0f6788c1b295ed99?branch=epel10.2
Log:
Package tests
---
diff --git a/.fmf/version b/.fmf/version
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/.fmf/version
@@ -0,0 +1 @@
+1
diff --git a/gating.yaml b/gating.yaml
new file mode 100644
index 0000000..282e16b
--- /dev/null
+++ b/gating.yaml
@@ -0,0 +1,7 @@
+--- !Policy
+product_versions:
+ - fedora-*
+decision_context: bodhi_update_push_stable
+subject_type: koji_build
+rules:
+ - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
diff --git a/perl-Sys-Virt.spec b/perl-Sys-Virt.spec
index 637cf9c..094e40a 100644
--- a/perl-Sys-Virt.spec
+++ b/perl-Sys-Virt.spec
@@ -9,6 +9,7 @@ Source0: https://cpan.metacpan.org/authors/id/D/DA/DANBERR/Sys-Virt-v%{ve
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: gcc
+BuildRequires: git
BuildRequires: libvirt-devel >= %{version}
BuildRequires: perl-devel
%if 0%{?fedora} || 0%{?rhel} > 7
@@ -30,11 +31,10 @@ BuildRequires: perl(Test::More)
BuildRequires: perl(Time::HiRes)
BuildRequires: perl(XML::XPath)
BuildRequires: perl(XML::XPath::XMLParser)
-# Optional tests only
-BuildRequires: perl(Test::CPAN::Changes)
-BuildRequires: perl(Test::Pod) >= 1.00
-BuildRequires: perl(Test::Pod::Coverage) >= 1.00
-BuildRequires: git
+# Optional tests are not executed
+#BuildRequires: perl(Test::CPAN::Changes)
+#BuildRequires: perl(Test::Pod) >= 1.00
+#BuildRequires: perl(Test::Pod::Coverage) >= 1.00
Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version))
%description
@@ -42,9 +42,33 @@ The Sys::Virt module provides a Perl XS binding to the libvirt virtual
machine management APIs. This allows machines running within arbitrary
virtualization containers to be managed with a consistent API.
+%package tests
+Summary: Tests for %{name}
+Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: perl-Test-Harness
+
+%description tests
+Tests from %{name}-%{version}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
%prep
%autosetup -S git -n Sys-Virt-v%{version}
+# Help file to recognise the Perl scripts and normalize shebangs
+for F in t/*.t; do
+ if head -1 "$F" | grep -q -e '^#!.*perl' ; then
+ perl -MConfig -pi -e 's|^#!.*perl\b|$Config{startperl}|' "$F"
+ else
+ perl -i -MConfig -ple 'print $Config{startperl} if $. == 1' "$F"
+ fi
+ chmod +x "$F"
+done
+
+# Remove release tests
+for F in t/005-pod.t t/010-pod-coverage.t t/015-changes.t; do
+ rm "$F"
+ perl -i -ne 'print $_ unless m{^\Q'"$F"'\E}' MANIFEST
+done
%build
perl Build.PL installdirs=vendor
@@ -53,9 +77,20 @@ perl Build.PL installdirs=vendor
%install
./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
+
+# Install tests
+mkdir -p %{buildroot}/%{_libexecdir}/%{name}
+cp -a t %{buildroot}/%{_libexecdir}/%{name}
+cat > %{buildroot}/%{_libexecdir}/%{name}/test << 'EOF'
+#!/bin/sh
+cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
+EOF
+chmod +x %{buildroot}/%{_libexecdir}/%{name}/test
+
%{_fixperms} $RPM_BUILD_ROOT/*
%check
+export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
./Build test
%files
@@ -65,10 +100,13 @@ find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
%{perl_vendorarch}/Sys*
%{_mandir}/man3/*
+%files tests
+%{_libexecdir}/%{name}
%changelog
* Tue Mar 02 2021 Jitka Plesnikova <jplesnik@redhat.com> - 7.1.0-1
- 7.1.0 bump
+- Package tests
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 7.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
diff --git a/plans/sanity.fmf b/plans/sanity.fmf
new file mode 100644
index 0000000..a72ded4
--- /dev/null
+++ b/plans/sanity.fmf
@@ -0,0 +1,5 @@
+summary: Sanity tests
+discover:
+ how: fmf
+execute:
+ how: tmt
diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf
new file mode 100644
index 0000000..b2a67a8
--- /dev/null
+++ b/tests/upstream-tests.fmf
@@ -0,0 +1,4 @@
+summary: Upstream tests
+component: perl-Sys-Virt
+require: perl-Sys-Virt-tests
+test: /usr/libexec/perl-Sys-Virt/test
reply other threads:[~2026-06-30 7:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=178280469824.1.768764923414603749.rpms-perl-Sys-Virt-f1f7d500d12d@fedoraproject.org \
--to=jplesnik@redhat.com \
--cc=git-commits@fedoraproject.org \
/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