Bug 196837 (pear-PHPUnit3)

Summary: Review Request: php-pear-PHPUnit - Regression testing framework for unit tests
Product: [Fedora] Fedora Reporter: Christopher Stone <chris.stone>
Component: Package ReviewAssignee: Remi Collet <fedora>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Package Reviews List <fedora-package-review>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: fedora, lxtnow, rpm
Target Milestone: ---Flags: fedora: fedora-review+
kevin: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-03-12 19:44:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 190101, 196749, 196802, 196827, 212887, 220862    
Bug Blocks: 163779    

Description Christopher Stone 2006-06-27 04:54:38 UTC
Spec URL: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit2.spec
SRPM URL: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit2-3.0.0-alpha11.1.src.rpm

Description:
PHPUnit is a family of PEAR packages (PHPUnit2 for PHP 5, PHPUnit for PHP 4)
that supports the development of object-oriented PHP applications using the
concepts and methods of Agile Software Development, Extreme Programming,
Test-Driven Development and Design-by-Contract Development by providing an
elegant and robust framework for the creation, execution and analysis of
Unit Tests.

Comment 3 Christopher Stone 2006-10-29 23:45:41 UTC
Im renaming this bug to PHPUnit3, however I think it will ultimately just be
called PHPUnit and Obsolete PHPUnit2.

Comment 4 Christopher Stone 2006-10-30 00:06:05 UTC
Updated to beta2, renamed package "PHPUnit", obsolete other PHPUnit packages

SPEC: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit.spec
SRPM:
http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit-3.0.0-0.1.beta2.src.rpm

%changelog
* Sun Oct 29 2006 Christopher Stone <chris.stone> 3.0.0-0.1.beta2
- Initial Release

Comment 5 Christopher Stone 2006-10-30 00:35:41 UTC
NOTE: I can't get this to build under mock.  We need to somehow install the
channel by hand without using the net.  The install instructions say to run:

pear channel-discover pear.phpunit.de

But it seems just copying over files into .channel/ is not enough?

Comment 6 Remi Collet 2006-10-30 16:21:58 UTC
My first reflexion :

We could make a php-channel-pear-phpunit-de (we have to find a "normalized"
name, it seems that channels are not pear/pecl specific) only  containing the
xml file for the channel (http://pear.phpunit.de/channel.xml) and

%post
if [ $1 -eq  1 ] ; then
   %{__pear} channel-add pear.phpunit.de.xml
else
   %{__pear} channel-update pear.phpunit.de.xml
fi

%postun
if [ $1 -eq 0 ] ; then
   %{__pear} channel-remove pear.phpunit.de
fi

All packages that use this channel should Requires and BuildRequires this new
RPM (remove all the package must be done before removing the channel).

To be tested.

Comment 7 Remi Collet 2006-10-30 16:39:34 UTC
You probably should 
Provides:       php-pear(%{pear_name}) = %{version}
Provides:       php-pear(%{pear_name}2) = %{version}
Obsoletes:      php-pear-PHPUnit2

But i don't know if it should obsolete PHPUnit as it doesn't provides
PHPUnit.php (and other files from PHPUnit-1.3.2) used by some old package test
suite (php-pear-Console-Getargs for ex.).

More time needed for me to test this package.

Cordialy.

Comment 8 Christopher Stone 2006-10-31 03:12:05 UTC
Remi, thanks for the comments.  I only assumed it overrides both 1&2 becuase
when I packaged 3 it had files for PHPUnit and PHPUnit2.  Also the web site says
you should uninstall those old versions before using the new one.  I don't know
what it does in reality though.

Could we install the channel in a %pre section in this package instead?  I think
that would be better than another package since I dont think there will be any
other RPMs using this channel.  But might be worth discussing for other channels
or if the phpunit channel will have other packages in it.

BTW, Remi, would you like to be co-maintainer with me on this package?

Comment 9 Remi Collet 2006-11-02 13:34:33 UTC
> Could we install the channel in a %pre section in this package instead? 

I think this will not help you to build on mock.

You prabably have to propose a packaging rules for this "channel" package on
fedora-packaging.

> BTW, Remi, would you like to be co-maintainer with me on this package?

"co-maintainer" is a little bit confusing for me with the actual fedora system,
but i agree to work with you on this.

Comment 10 Jason Tibbitts 2006-11-29 03:57:19 UTC
So what did you end up deciding to do here?  I don't see a problem with a
package that sets up the channel; it seems to be the most reasonable thing to do
here.

Comment 11 Christopher Stone 2006-11-29 04:34:24 UTC
We have to figure out if phpunit3 actually replaces phpunit 1 and 2.  Remi said
that it doesn't provide phpunit.php so I have to investigate further.  In
addition 3.0.0 final was released about a week or so ago, so I need to update
the spec for the stable version.

Comment 12 Jason Tibbitts 2006-12-28 01:57:31 UTC
Any movement here?  It would be nice to get this closed out once and for all. 
I'm hapy to review this even if it doesn't end up replacing the older versionf
of PHPUnit.

Comment 13 Christopher Stone 2006-12-28 04:35:12 UTC
SPEC: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit.spec
SRPM: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit-3.0.0-1.src.rpm

New SRPM updating to 3.0.0 final.  Incorporates Remi's suggestion of adding a
channel package.

For some really strange reason, if you have php-pear-PHPUnit2 installed, and rpm
-Uvh this package, it will remove all the files that are in common between the
two packages.  I do not understand why, either I am doing something wrong or
there is a bug in rpm.

Comment 14 Christopher Stone 2006-12-28 16:56:39 UTC
Okay, I think I know what is going on with the Provides/Obsoletes for PHPUnit2.
 When PHPUnit2 gets to its %postun section it calls pear uninstall which removes
the files.  So I don't think we can use Provides/Obsoletes in this case.  We
probably have to explicitly use a Conflicts tag in this case.  Comments/Suggestions?

Comment 15 Remi Collet 2006-12-30 17:12:29 UTC
I confirm that it's a pear bug.
I file it : http://pear.php.net/bugs/bug.php?id=9712

So using Conflicts seems a good workaround.

Comment 16 Christopher Stone 2007-01-05 23:17:55 UTC
SPEC: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit.spec
SRPM: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit-3.0.1-1.src.rpm

%changelog
* Fri Jan 05 2007 Christopher Stone <chris.stone> 3.0.1-1
- Upstream Sync


Comment 17 Christopher Stone 2007-01-08 21:27:32 UTC
NOTE: This package is only meant to be built/used on devel/fc7+.

Comment 18 Christopher Stone 2007-01-15 00:01:46 UTC
SPEC: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit.spec
SRPM: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit-3.0.2-1.src.rpm

%changelog
* Sun Jan 14 2007 Christopher Stone <chris.stone> 3.0.2-1
- Upstream sync


Comment 20 Christopher Stone 2007-01-30 01:50:46 UTC
SPEC: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit.spec
SRPM: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit-3.0.3-1.src.rpm

%changelog
* Mon Jan 29 2007 Christopher Stone <chris.stone> 3.0.3-1
- Upstream sync


Comment 21 Christopher Stone 2007-02-21 22:21:25 UTC
SPEC: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit.spec
SRPM: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit-3.0.4-1.src.rpm

%changelog
* Wed Feb 21 2007 Christohper Stone <chris.stone> 3.0.4-1
- Upstream sync


Comment 22 Christopher Stone 2007-02-26 18:26:16 UTC
SPEC: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit.spec
SRPM: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit-3.0.5-1.src.rpm

%changelog
* Mon Feb 26 2007 Christopher Stone <chris.stone> 3.0.5-1
- Upstream sync


Comment 23 Remi Collet 2007-02-26 23:03:16 UTC
Really sorry, i haven't notice that this (old) review is not assigned.
So i will make the review (ASAP).

First comment : pear bug #9712 is close (my patch is merge upstream) and pear
1.5.0 is now available in rawhide, so i think you should swicth back to :
Requires: php-pear >= 1:1.5.0
Obsoletes: php-pear-PHPUnix2

No need to a new spec file, i will work on this release for the review.

Comment 24 Remi Collet 2007-02-27 18:16:24 UTC
REVIEW
* source files match upstream:
fca4887ed95996a4b18e0cb0b8ff8130  PHPUnit-3.0.5.tgz* package meets naming and
packaging guidelines.
* specfile is properly named, is cleanly written and uses macros consistently.
* dist tag is present.
* build root is correct.
* license field matches the actual license.
* license is open source-compatible (BSD).
* latest version is being packaged (3.0.5)
* BuildRequires are proper.
* %clean is present.
* package builds in mock (FC6).
* package installs properly
* rpmlint is silent.
* final provides are sane:
php-pear(pear.phpunit.de/PHPUnit) = 3.0.5
php-pear-PHPUnit = 3.0.5-1.fc7
=> final Requires are sane:
see comment
* %check is not present; 
=> don't owns the directories it creates
* don't own directories it shouldn't.
* no duplicates in %files.
* file permissions are appropriate.
* scriptlets are OK (pear install)
* code, not content.
* documentation is small, so no -docs subpackage is necessary.
* %docs are not necessary for the proper functioning of the package.

Samples works well.

So MUST
- remove Conflicts (add Obsoletes)
- Requires: php-pear(PEAR) >= 1.5.0
- own %{pear_testdir}/%{pear_name}

Should 
- Remove (build safely, even in mock without)
# Need to allow installation in channel://pear.phpunit.de/
mkdir -p $RPM_BUILD_ROOT%{pear_phpdir}
cp -r %{pear_phpdir}/.channels $RPM_BUILD_ROOT%{pear_phpdir}/.channels

- simplify under doc (remove PHPUnit subdir)
%doc %{pear_name}-%{version}/docdir/%{pear_name}/%{pear_name}/*

- only uninstall old PHPunit on upgrade
%post
if [ $1 -gt  1 ] ; then
  ...
fi

Comment 25 Christopher Stone 2007-03-08 00:46:11 UTC
SPEC: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit.spec
SRPM: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit-3.0.5-2.src.rpm

%changelog
* Wed Mar 07 2007 Christopher Stone <chris.stone> 3.0.5-2
- Add Obsoletes/Provides for php-pear(PHPUnit2)
- Requires php-pear(PEAR) >= 1.5.0
- Own %%{pear_testdir}/%%{pear_name}
- Remove no longer needed manual channel install
- Simplify %%doc
- Only unregister old phpunit on upgrade


Comment 26 Remi Collet 2007-03-08 07:45:28 UTC
Updating from php-pear-PHPUnit-1.3.2 + php-pear-PHPUnit2-2.3.6 to
php-pear-PHPUnit-3.0.5 work well (rpm -V php-pear-PHPUnit is silent)

$ rpm -qf /usr/share/pear/test/PHPUnit/
file /usr/share/pear/test/PHPUnit is not owned by any package

Please change
%{pear_testdir}/%{pear_name}/%{pear_name}
to
%{pear_testdir}/%{pear_name}

I don't think this is a valid provides
Provides:       php-pear(%{pear_name}2) < 3.0.0

Should be 
Provides:       php-pear(%{pear_name}2) = %{version}


Comment 27 Christopher Stone 2007-03-08 08:13:18 UTC
SPEC: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit.spec
SRPM: http://tkmame.retrogames.com/fedora-extras/php-pear-PHPUnit-3.0.5-3.src.rpm

%changelog
* Thu Mar 08 2007 Christopher Stone <chris.stone> 3.0.5-3
- Fix testdir
- Fix Provides version


Comment 28 Remi Collet 2007-03-10 14:45:13 UTC
* APPROVED *

Comment 29 Remi Collet 2007-03-10 14:48:13 UTC
CVS Request :

Please change Christopher as the owner of this package (updating the old one i
own, for devel/F7).

Keep me in the Cc list (for FC5/FC6).

Regards

Comment 30 Christopher Stone 2007-03-10 22:42:30 UTC
Update Package CVS Request
==========================
Owners: chris.stone
InitialCC: Fedora

NOTE: This is not a new package, only the ownership is changing in devel branch,
and previous owner (Remi) is being added to InitialCC list.


Comment 31 Christopher Stone 2007-03-12 19:44:07 UTC
- Updated spec and sources on devel branch
- Built for devel

Thanks for the review!! 

:D

Comment 32 Christopher Stone 2008-02-13 21:37:34 UTC
Package Change Request
======================
Package Name: php-pear-PHPUnit
New Branches: EL-5


Comment 33 Kevin Fenzi 2008-02-13 23:05:18 UTC
cvs done.