Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 411155 - media-gfx/imagemagick - newer ebuilds have broken src_test check
Summary: media-gfx/imagemagick - newer ebuilds have broken src_test check
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal QA (vote)
Assignee: Gentoo Graphics Project
URL:
Whiteboard:
Keywords: PATCH
: 429686 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-04-07 15:26 UTC by Jeroen Roovers (RETIRED)
Modified: 2012-08-04 00:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2012-04-07 15:26:01 UTC
[1] The new ebuilds hard-code the CATEGORY and P whereas the old ones correctly
    didn't. I don't see any way the new code is better
[2] The has_version test is wrong: IF the SAME (see [1]) version is installed,
    THEN the test suite should be run. If not, do nothing.
[3] There wasn't actually anything wrong with the old code. The ChangeLog doesn't
    even reflect this change, so the rationale for this special test requirement
   should be documented in src_test().

--- imagemagick-6.7.6.4.ebuild  7 Apr 2012 15:03:51 -0000       1.4
+++ imagemagick-6.7.6.4.ebuild  7 Apr 2012 15:24:06 -0000
@@ -129,7 +129,8 @@
 }
 
 src_test() {
-       has_version media-gfx/imagemagick || emake -j1 check
+       # Tests are run against the same version of the installed package
+       has_version ${CATEGORY}/${P} && emake -j1 check
 }
 
 src_install() {
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2012-04-07 16:01:15 UTC
Sorry, this is leftover from my earlier attempt at fixing the testsuite. Restored it now the way it was.
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2012-04-07 16:04:22 UTC
err, actually there was nothing wrong with the way it was in the newer ebuilds either. 
the testsuite only got executed when imagemagick wasn't installed, therefore versions always matching (always using the just built copy).
now that I think of it, it was propably better in the new way. less error prone.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2012-04-07 16:19:54 UTC
(In reply to comment #2)
> err, actually there was nothing wrong with the way it was in the newer
> ebuilds either. 
> the testsuite only got executed when imagemagick wasn't installed, therefore
> versions always matching (always using the just built copy).
> now that I think of it, it was propably better in the new way. less error
> prone.

No, the new logic you introduced was wrong, which is why you now changed it back. Thanks for that.

(For reasons still not documented in src_test(),) the test suite would only work (properly) when the same version was already installed (which is at odds with most other packages, which let you run check prior to installation as a safety measure).
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2012-04-07 16:36:03 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > err, actually there was nothing wrong with the way it was in the newer
> > ebuilds either. 
> > the testsuite only got executed when imagemagick wasn't installed, therefore
> > versions always matching (always using the just built copy).
> > now that I think of it, it was propably better in the new way. less error
> > prone.
> 
> No, the new logic you introduced was wrong, which is why you now changed it
> back. Thanks for that.
> 
> (For reasons still not documented in src_test(),) the test suite would only
> work (properly) when the same version was already installed (which is at
> odds with most other packages, which let you run check prior to installation
> as a safety measure).

You seem to confuse things.

The now removed 'new way' was `has_version media-gfx/imagemagick || emake -j1 check` which means testsuite always runs, long as imagemagick is not installed. 

So `emerge -C imagemagick` and  `FEATURES=test emerge -1 imagemagick` allowed you to run tests. A bit like blockers pointing to same package. This is the most safest way since then always the copy from /var/tmp/port... gets ran.

The now restored 'old way' is same as above, with only 1 exception that now it allows you run tests against the installed system copy if the versions match. 

(And I'm not sure if that is good idea which makes me actually want to restore the 'new way' until more proper solution is available.)
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2012-04-07 16:41:40 UTC
The whole point is to avoid executing tests with older or newer non-matching ImageMagick from system.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2012-04-07 17:08:59 UTC
So you could improve the situation by checking both.

if has_version ~$(CATEGORY}/${P} || ! has_VERSION $(CATEGORY}/${PN}; then
    emake -j1 check
fi

Instead expecting users who want to run the test suite to break their running systems by first unmerging the installed package is clearly less desirable.

For upgrading users, an einfo message should help inform them when and why the test suite wasn't run, so the above code could be further improved. Having a bug reference in the src_test() would help fixing the upstream problem (the test suite preferring installed files over build files) in the future.
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2012-05-10 14:04:37 UTC
left it the way it's now in the ebuild
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2012-08-04 00:48:50 UTC
*** Bug 429686 has been marked as a duplicate of this bug. ***