#1 Tests
Merged 2 years ago by jplesnik. Opened 2 years ago by jplesnik.
Unknown source rawhide  into  rawhide

file added
+1
@@ -0,0 +1,1 @@

+ 1

file modified
+1
@@ -12,3 +12,4 @@

  /Git-CPAN-Patch-2.3.3.tar.gz

  /Git-CPAN-Patch-2.3.4.tar.gz

  /Git-CPAN-Patch-2.4.0.tar.gz

+ /Git-CPAN-Patch-2.5.0.tar.gz

file added
+7
@@ -0,0 +1,7 @@

+ --- !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}

file modified
+49 -4
@@ -1,7 +1,7 @@

  Name:           perl-Git-CPAN-Patch

  Summary:        Patch CPAN modules using Git

- Version:        2.4.0

- Release:        2%{?dist}

+ Version:        2.5.0

+ Release:        1%{?dist}

  License:        GPL+ or Artistic

  Source0:        https://cpan.metacpan.org/authors/id/Y/YA/YANICK/Git-CPAN-Patch-%{version}.tar.gz

  URL:            https://metacpan.org/release/Git-CPAN-Patch
@@ -21,7 +21,6 @@

  BuildRequires:  perl(Archive::Extract)

  BuildRequires:  perl(autodie)

  BuildRequires:  perl(BackPAN::Index)

- BuildRequires:  perl(CLASS)

  BuildRequires:  perl(CPAN::Meta)

  BuildRequires:  perl(CPAN::ParseDistribution)

  BuildRequires:  perl(CPANPLUS)
@@ -96,10 +95,26 @@

  local git repository and, once gleeful hacking has been perpetrated,

  sending back patches to its maintainer.

  

+ %package tests

+ Summary:        Tests for %{name}

+ Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}

+ Requires:       git

+ Requires:       perl(Git::Repository::Plugin::AUTOLOAD)

+ Requires:       perl-Test-Harness

+ 

+ %description tests

+ Tests from %{name}. Execute them

+ with "%{_libexecdir}/%{name}/test".

+ 

  %prep

  %setup -q -n Git-CPAN-Patch-%{version}

  # Fix shellbang

  perl -MConfig -pi -e 's|^#!/usr/bin/env perl|$Config{startperl} |' bin/git-cpan

+ # 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
@@ -112,9 +127,32 @@

  install -d -m 0755 %{buildroot}%{_libexecdir}/git-core

  mv %{buildroot}/%{_bindir}/* %{buildroot}%{_libexecdir}/git-core/

  

+ # Install tests

+ mkdir -p %{buildroot}%{_libexecdir}/%{name}

+ cp -a t %{buildroot}%{_libexecdir}/%{name}

+ mkdir -p %{buildroot}%{_libexecdir}/%{name}/bin

+ ln -s %{_libexecdir}/git-core/git-cpan %{buildroot}%{_libexecdir}/%{name}/bin

+ cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'

+ #!/bin/sh

+ git config --global user.email "perl-Git-CPAN-Patch-owner@fedoraproject.org"

+ git config --global user.name "perl-Git-CPAN-Patch Owner"

+ git config --global init.defaultBranch "development"

+ set -e

+ # Some tests write into temporary files/directories. The easiest solution

+ # is to copy the tests into a writable directory and execute them from there.

+ 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

  git config --global user.email "perl-Git-CPAN-Patch-owner@fedoraproject.org"

  git config --global user.name "perl-Git-CPAN-Patch Owner"

+ git config --global init.defaultBranch "development"

  make test

  

  %files
@@ -126,10 +164,17 @@

  %files -n git-cpan-patch

  %license LICENSE

  %doc AUTHOR_PLEDGE Changes README.mkdn

- %{_libexecdir}/*

+ %{_libexecdir}/git-core

  %{_mandir}/man1/*

  

+ %files tests

+ %{_libexecdir}/%{name}

+ 

  %changelog

+ * Wed Mar 23 2022 Jitka Plesnikova <jplesnik@redhat.com> - 2.5.0-1

+ - 2.5.0 bump

+ - Package tests

+ 

  * Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

  

file added
+5
@@ -0,0 +1,5 @@

+ summary: Sanity tests

+ discover:

+     how: fmf

+ execute:

+     how: tmt

file modified
+1 -1
@@ -1,1 +1,1 @@

- SHA512 (Git-CPAN-Patch-2.4.0.tar.gz) = a0348fadb923824ff5b3a7617a6a5b2588453c90ca7401fe0fe9c04582ecebbc75aba71751633522280995a6519f7c92ee8d9088d377482678476a4ffbcc96a5

+ SHA512 (Git-CPAN-Patch-2.5.0.tar.gz) = fa4526cbacaf834aca767760d1f0a33670c3226cbe013f41495119ff9676fee4b3826db0aeb39eb2623a6c34475d9e1650de783feadd532fa7b338c8d0f2cbd6

@@ -0,0 +1,4 @@

+ summary: Upstream tests

+ component: perl-Git-CPAN-Patch

+ require: perl-Git-CPAN-Patch-tests

+ test: /usr/libexec/perl-Git-CPAN-Patch/test