From acbdc78f456b51b966a5fac7014c386506a5ff13 Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Wed, 24 Jul 2024 14:08:33 +0200 Subject: [PATCH] Add tests and gating.yaml --- .fmf/version | 1 + gating.yaml | 7 +++++++ perl-IPC-Run3.spec | 40 ++++++++++++++++++++++++++++++++++++++-- plans/sanity.fmf | 5 +++++ tests/upstream-tests.fmf | 12 ++++++++++++ 5 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 .fmf/version create mode 100644 gating.yaml create mode 100644 plans/sanity.fmf create mode 100644 tests/upstream-tests.fmf 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..1608530 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +# RHEL +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/perl-IPC-Run3.spec b/perl-IPC-Run3.spec index dc5a0bb..3f7af11 100644 --- a/perl-IPC-Run3.spec +++ b/perl-IPC-Run3.spec @@ -1,6 +1,6 @@ Name: perl-IPC-Run3 Version: 0.049 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Run a subprocess in batch mode License: GPL-1.0-or-later OR Artistic-1.0-Perl OR BSD-2-Clause URL: https://metacpan.org/release/IPC-Run3 @@ -9,6 +9,7 @@ BuildArch: noarch BuildRequires: %{__make} BuildRequires: perl-generators +BuildRequires: perl-interpreter BuildRequires: perl(Carp) BuildRequires: perl(Exporter) BuildRequires: perl(ExtUtils::MakeMaker) @@ -38,8 +39,22 @@ and/or stderr to files and perl data structures. It aims to satisfy 99% of the need for using system, qx, and open3 with a simple, extremely Perlish API and none of the bloat and rarely used features of IPC::Run. +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + %prep %setup -q -n IPC-Run3-%{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 @@ -47,7 +62,22 @@ API and none of the bloat and rarely used features of IPC::Run. %install %{make_install} -%{_fixperms} $RPM_BUILD_ROOT/* +%{_fixperms} %{buildroot}/* +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +rm %{buildroot}%{_libexecdir}/%{name}/t/pod* +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/bash +set -e +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 %{__make} test RELEASE_TESTING=1 @@ -58,7 +88,13 @@ API and none of the bloat and rarely used features of IPC::Run. %{perl_vendorlib}/* %{_mandir}/man3/* +%files tests +%{_libexecdir}/%{name} + %changelog +* Wed Jul 24 2024 Jitka Plesnikova - 0.049-3 +- Package tests + * Mon Jun 24 2024 Troy Dawson - 0.049-2 - Bump release for June 2024 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..8a0a3b5 --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,12 @@ +summary: Upstream tests +contact: Jitka Plesnikova +component: perl-IPC-Run3 +require: perl-IPC-Run3-tests +test: /usr/libexec/perl-IPC-Run3/test +enabled: true +tag: + - rhel-buildroot +adjust: + - enabled: false + when: distro < rhel-10 or distro < centos-stream-10 + continue: false