Add tests and gating.yaml

This commit is contained in:
Jitka Plesnikova 2024-07-23 16:59:40 +02:00
parent 206f68922d
commit 1f21c7374e
5 changed files with 63 additions and 3 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
# RHEL
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,6 +1,6 @@
Name: perl-File-Remove
Version: 1.61
Release: 8%{?dist}
Release: 9%{?dist}
Summary: Convenience module for removing files and directories
License: GPL-1.0-or-later OR Artistic-1.0-Perl
@ -12,6 +12,7 @@ BuildRequires: %{__make}
BuildRequires: perl-generators
BuildRequires: perl(blib)
BuildRequires: perl(Config)
BuildRequires: perl(constant)
BuildRequires: perl(Cwd) >= 3.29
BuildRequires: perl(ExtUtils::MakeMaker)
@ -33,16 +34,44 @@ BuildArch: noarch
%description
%{summary}
%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 File-Remove-%{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
%{make_build}
%install
%{make_install} DESTDIR="$RPM_BUILD_ROOT"
%{_fixperms} "$RPM_BUILD_ROOT"/*
%{make_install}
%{_fixperms} %{buildroot}/*
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
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
@ -53,7 +82,13 @@ BuildArch: noarch
%{perl_vendorlib}/File
%{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog
* Tue Jul 23 2024 Jitka Plesnikova <jplesnik@redhat.com> - 1.61-9
- Package tests
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.61-8
- Bump release for June 2024 mass rebuild

5
plans/sanity.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Sanity tests
discover:
how: fmf
execute:
how: tmt

12
tests/upstream-tests.fmf Normal file
View File

@ -0,0 +1,12 @@
summary: Upstream tests
contact: Jitka Plesnikova <jplesnik@redhat.com>
component: perl-File-Remove
require: perl-File-Remove-tests
test: /usr/libexec/perl-File-Remove/test
enabled: true
tag:
- rhel-buildroot
adjust:
- enabled: false
when: distro < rhel-10 or distro < centos-stream-10
continue: false