#296 Simplifying Ruby Packaging Guidelines
Closed: Invalid None Opened 10 years ago by jstribny.

Section: Test suites not included in the package

I propose a slightly different approach regarding unpacking test suites that are not used during %build nor %install and that don't come with the final RPM.

The suggesting is to omit unpacking tests during %prep and than copying in %check and actually unpack the tests in %check just before running them. This way it's easier to know where the tests came from and we get rid of unnecessary cp.

Example of SRPM where this is already in use: rubygem-activemodel.

Current state:

{{{

git clone https://github.com/bebanjo/delorean.git && cd delorean

git checkout v1.2.0

tar -czf rubygem-delorean-1.2.0-specs.tgz spec/

Source1: %{name}-%{version}-specs.tgz

...

%prep
%setup -q -D -T -n %{gem_name}-%{version}

tar -xzf %{SOURCE1}

...

%check
cp -pr spec/ ./%{gem_instdir}
pushd ./%{gem_instdir}

Run tests

rm -rf spec
popd

...

}}}

Suggested state:
{{{

git clone https://github.com/bebanjo/delorean.git && cd delorean

git checkout v1.2.0

tar -czf rubygem-delorean-1.2.0-specs.tgz spec/

Source1: %{name}-%{version}-specs.tgz

...

%prep
%setup -q -D -T -n %{gem_name}-%{version}

...

%check
pushd ./%{gem_instdir}
tar -xzf %{SOURCE1}

Run tests

rm -rf spec
popd

...

}}}


I support this idea. Actually, the benefit is, that the test suite will never get included in resulting package, so we can get rid of

{{{

Run tests

rm -rf spec
}}}

lines as well.

This has the same problems as installing the main source in %build did in the original guidelines (https://fedorahosted.org/fpc/ticket/134#comment:25 : breaks rpmbuild -b[p|c|i] and --shortcircuit, means that patching to correct the testsuite can't use the %patch macros, breaks quilt setup SPECFILE, etc).

-1 from me.

You are right, it may break, but not for my workflow. Neither is should break anyones workflow. Promoting "rpmbuild -b[p|c|i] and --shortcircuit" is bad practice IMO. That are debugging procedures, not procedures one really needs for packaging. The only think it matters is if the package can be rebuild in Koji and clean mock environment.

The Packaging Committee considered this request, but rejected it unanimously (+1:0, 0:0, -1:7).

Tests must be unpacked at %prep to allow for them to be properly patched.

I read the FPC meeting log and I have to add a few remarks:

16:12:31 <tibbs|w> Not a fan of this, and really not a fan of the attitude in the last comment there.[[BR]]
16:12:52 <tibbs|w> "Doesn't break anything for me; anything I don't use is not useful."

FPC is trying hard to apply the workflows of other programming languages packaging to rubygems and find purpose for "rpmbuild -b[p|c|i] and --shortcircuit". It would be nice, if FPC can first get some experience with rubygems and their packaging prior you start to judge and misinterpret me.

16:13:24 <spot> since i cannot count how many test suites i've had to patch in Fedora...

That is true, but statistically, I use quite often sed and not patch. And to be honest, %patch macro in %prep section is not such a huge win. You can always resort to "cat %{PATCH0} | patch -p1" or something similar.

16:13:33 <abadger1999> vondruch has been told multiple times and still doesn't get it...

Yes, I was told and sorry, I will never get it.

16:13:51 <spot> limburgher: eh, unlikely. I think its more that they don't want to have to keep the test files from ending up in the gem

Yes, that is the point. Although RubyGems has infrastructure to execute test suite during or after installation of gem, it is typically not straightforward to run the test suite (the test dependencies would need to be satisfied, etc), so it is getting common that upstream gem does not carry its test suite. This is promoted by RoR upstream and I agree with that decision. It is just unnecessary ballast.

16:17:53 <RemiFedora> at least I think packager should request upstream to "please include unit test in official tarball" (which I have done so many time)

We are not dealing with tarballs but with rubygems. Although I acknowledge that test suite has its place in upstream tarball, they should not be shipped in rubygems.

Replying to [comment:5 vondruch]:

FPC is trying hard to apply the workflows of other programming languages packaging to rubygems and find purpose for "rpmbuild -b[p|c|i] and --shortcircuit". It would be nice, if FPC can first get some experience with rubygems and their packaging prior you start to judge and misinterpret me.

Both spot and I have built rubygems and the old guidelines that do not unpack the source in %prep are just broken for the reasons that were given above (of which, you choose to only remember rpmbuild --shortcircuit....)

16:13:33 <abadger1999> vondruch has been told multiple times and still doesn't get it...

Yes, I was told and sorry, I will never get it.

In that case, you might want to consider working on a different distribution. People who can try to understand the other reasons that have been taken into consideration and deemed more important and modify their future thoughts according to those weights have the ability to work to improve a system. Those who can't are doomed to be frustrated as they fight vainly against those things and frustrate all the people they come in contact with as they continuously propose the same invalidated arguments for similar problems which just causes everyone extra work.

Login to comment on this ticket.

Metadata