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 Name: perl-Data-Section
Version: 0.200008 Version: 0.200008
Release: 6%{?dist} Release: 7%{?dist}
Summary: Read multiple hunks of data out of your DATA section Summary: Read multiple hunks of data out of your DATA section
License: GPL-1.0-or-later OR Artistic-1.0-Perl License: GPL-1.0-or-later OR Artistic-1.0-Perl
URL: https://metacpan.org/release/Data-Section URL: https://metacpan.org/release/Data-Section
@ -22,7 +22,8 @@ BuildRequires: findutils
BuildRequires: make BuildRequires: make
BuildRequires: perl-generators BuildRequires: perl-generators
BuildRequires: perl-interpreter BuildRequires: perl-interpreter
BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
# Runtime # Runtime
BuildRequires: perl(Encode) BuildRequires: perl(Encode)
BuildRequires: perl(MRO::Compat) >= 0.09 BuildRequires: perl(MRO::Compat) >= 0.09
@ -45,22 +46,51 @@ BuildRequires: perl(Test::Pod) >= 1.41
%endif %endif
# Dependencies # 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 %description
Data::Section provides an easy way to access multiple named chunks of 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 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. 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 %prep
%setup -q -n Data-Section-%{version} %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 %build
perl Makefile.PL INSTALLDIRS=vendor perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
make %{?_smp_mflags} %{make_build}
%install %install
make pure_install DESTDIR=$RPM_BUILD_ROOT %{make_install}
find $RPM_BUILD_ROOT -type f -name .packlist -delete %{_fixperms} -c %{buildroot}
%{_fixperms} -c $RPM_BUILD_ROOT
# 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 %check
make test make test
@ -74,7 +104,13 @@ make test TEST_FILES="$(echo $(find xt/ -name '*.t'))"
%{perl_vendorlib}/Data/ %{perl_vendorlib}/Data/
%{_mandir}/man3/Data::Section.3* %{_mandir}/man3/Data::Section.3*
%files tests
%{_libexecdir}/%{name}
%changelog %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 * Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.200008-6
- Bump release for June 2024 mass rebuild - 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