Add tests and gating.yaml

This commit is contained in:
Jitka Plesnikova 2024-07-23 12:39:25 +02:00
parent e7580e392a
commit 7dc753fbfa
5 changed files with 68 additions and 7 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

@ -10,7 +10,7 @@
Name: perl-Data-Section
Version: 0.200008
Release: 6%{?dist}
Release: 7%{?dist}
Summary: Read multiple hunks of data out of your DATA section
License: GPL-1.0-or-later OR Artistic-1.0-Perl
URL: https://metacpan.org/release/Data-Section
@ -22,7 +22,8 @@ BuildRequires: findutils
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
# Runtime
BuildRequires: perl(Encode)
BuildRequires: perl(MRO::Compat) >= 0.09
@ -45,22 +46,51 @@ BuildRequires: perl(Test::Pod) >= 1.41
%endif
# Dependencies
# Filter modules bundled for tests
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(I::.*\\)
%global __requires_exclude %{__requires_exclude}|^perl\\((Child|End|Godfather|Grandchild)\\)
%global __requires_exclude %{__requires_exclude}|^perl\\((Header|Latin1|Mother|Relaxed|No.*)\\)
%global __requires_exclude %{__requires_exclude}|^perl\\((Unicode_.*pragma|WindowsNewlines)\\)
%description
Data::Section provides an easy way to access multiple named chunks of
line-oriented data in your module's DATA section. It was written to allow
modules to store their own templates, but probably has other uses.
%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 Data-Section-%{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
make %{?_smp_mflags}
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build}
%install
make pure_install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name .packlist -delete
%{_fixperms} -c $RPM_BUILD_ROOT
%{make_install}
%{_fixperms} -c %{buildroot}
# 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 . -r -j "$(getconf _NPROCESSORS_ONLN)"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
make test
@ -74,7 +104,13 @@ make test TEST_FILES="$(echo $(find xt/ -name '*.t'))"
%{perl_vendorlib}/Data/
%{_mandir}/man3/Data::Section.3*
%files tests
%{_libexecdir}/%{name}
%changelog
* Tue Jul 23 2024 Jitka Plesnikova <jplesnik@redhat.com> - 0.200008-7
- Package tests
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.200008-6
- 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-Data-Section
require: perl-Data-Section-tests
test: /usr/libexec/perl-Data-Section/test
enabled: true
tag:
- rhel-buildroot
adjust:
- enabled: false
when: distro < rhel-10 or distro < centos-stream-10
continue: false