public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-Log-Contextual] epel10.2: Package tests
@ 2026-07-28 11:00 Jitka Plesnikova
0 siblings, 0 replies; only message in thread
From: Jitka Plesnikova @ 2026-07-28 11:00 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/perl-Log-Contextual
Branch : epel10.2
Commit : 95a816d858439453d3c408a5f27ffd7fc0410666
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date : 2024-05-20T09:21:39+02:00
Stats : +73/-0 in 5 file(s)
URL : https://src.fedoraproject.org/rpms/perl-Log-Contextual/c/95a816d858439453d3c408a5f27ffd7fc0410666?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..3b56a2d
--- /dev/null
+++ b/gating.yaml
@@ -0,0 +1,16 @@
+--- !Policy
+product_versions:
+ - fedora-*
+decision_context: bodhi_update_push_testing
+subject_type: koji_build
+rules:
+ - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
+
+# Rawhide
+--- !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-Log-Contextual.spec b/perl-Log-Contextual.spec
index 74c82c2..90ed232 100644
--- a/perl-Log-Contextual.spec
+++ b/perl-Log-Contextual.spec
@@ -11,6 +11,7 @@ BuildRequires: findutils
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
+BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
@@ -38,14 +39,37 @@ Requires: perl(Moo) >= 1.003000
# Filter under-specified depenedencies
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(Moo\\)\\s*$
+# Filter modules bundled for tests
+%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
+%global __requires_exclude %{__requires_exclude}|^perl\\(BaseLogger\\)\\s*$
+%global __requires_exclude %{__requires_exclude}|^perl\\(DefaultImportLogger\\)\\s*$
+%global __requires_exclude %{__requires_exclude}|^perl\\(My::Module.*\\)\\s*$
+%global __requires_exclude %{__requires_exclude}|^perl\\(TestExporter\\)\\s*$
+%global __requires_exclude %{__requires_exclude}|^perl\\(TestRouter\\)\\s*$
+
%description
This module is a simple interface to extensible logging. It is bundled with
a really basic logger, Log::Contextual::SimpleLogger, but in general you
should use a real logger instead of that. For something more serious but
not overly complicated, try Log::Dispatchouli.
+%package tests
+Summary: Tests for %{name}
+Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: perl-Test-Harness
+Requires: perl(Log::Log4perl) >= 1.29
+
+%description tests
+Tests from %{name}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
%prep
%setup -q -n Log-Contextual-%{version}
+# Help generators to recognize Perl scripts
+for F in t/*.t; do
+ perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
+ chmod +x "$F"
+done
%build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
@@ -55,7 +79,25 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_install}
%{_fixperms} %{buildroot}/*
+# Install tests - copy tests to tmp
+mkdir -p %{buildroot}/%{_libexecdir}/%{name}
+cp -a t %{buildroot}/%{_libexecdir}/%{name}
+cat > %{buildroot}/%{_libexecdir}/%{name}/test << 'EOF'
+#!/bin/bash
+set -e
+# Some tests write into temporary files/directories.
+DIR=$(mktemp -d)
+pushd "$DIR"
+cp -a %{_libexecdir}/%{name}/* ./
+prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
+popd
+rm -rf "$DIR"
+EOF
+chmod +x %{buildroot}%{_libexecdir}/%{name}/test
+
%check
+unset AUTHOR_TESTING
+export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
make test
%files
@@ -64,9 +106,13 @@ make test
%{perl_vendorlib}/Log/Contextual*
%{_mandir}/man3/Log::Contextual*
+%files tests
+%{_libexecdir}/%{name}
+
%changelog
* Mon May 20 2024 Jitka Plesnikova <jplesnik@redhat.com> - 0.009000-1
- 0.009000 bump (rhbz#2280993)
+- Package tests
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.008001-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_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..ac9ff04
--- /dev/null
+++ b/tests/upstream-tests.fmf
@@ -0,0 +1,5 @@
+summary: Upstream tests
+contact: Jitka Plesnikova <jplesnik@redhat.com>
+component: perl-Log-Contextual
+require: perl-Log-Contextual-tests
+test: /usr/libexec/perl-Log-Contextual/test
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-28 11:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 11:00 [rpms/perl-Log-Contextual] epel10.2: Package tests Jitka Plesnikova
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox