[request-tracker-maintainers] Bug#799591: request-tracker4: difficult to run extension test suites

Dominic Hargreaves dom at earth.li
Sun Sep 20 17:11:39 UTC 2015


Package: request-tracker4
Version: 4.2.12-2
Severity: wishlist
Tags: patch

I didn't get any response to this, but I'm planning to go ahead
and applies these patches, so filing this bug as a record.

Dominic.

----- Forwarded message from Dominic Hargreaves <dom at earth.li> -----

Date: Thu, 7 May 2015 23:26:25 +0100
From: Dominic Hargreaves <dom at earth.li>
To: rt-devel at lists.bestpractical.com
Cc: pkg-request-tracker-maintainers at lists.alioth.debian.org
Subject: [request-tracker-maintainers] Extension testing fun and games

Hello,

I've spent several evenings banging my head against the problem of running
the test suite of an RT extension against the installed version of RT,
in the context of Debian packaging. I've been down various ugly paths
and now I now have something which works, but it still needs a bit more work.

There are three patches involved:

Patch one (to RT):

http://anonscm.debian.org/cgit/pkg-request-tracker/request-tracker4.git/commit/?h=dom/extension-testing&id=2c5db8d00625b312422ea35e2c904d41edc361ed

(Load RT::Generated from @INC rather than hard-coding the location from
RT.pm)

This seems sane enough, although I suspect it may break in some
installations. Maybe it should be wrapped in an

if ($ENV{'INSTALLED_TESTING') {

}

or some such. I'm not quite sure why it was originally done this way,
but given it is this way, breakage is likely.

Patch two (to RT):

http://anonscm.debian.org/cgit/pkg-request-tracker/request-tracker4.git/commit/?h=dom/extension-testing&id=33f14b541751b7da03542ec524179cae02af71bd

(RT::Test: add $RTDatabaseType from the environment to the generated
RT_SiteConfig.pm if set).

Seems non-controversial.

Patch three (to the extension):

http://anonscm.debian.org/cgit/pkg-request-tracker/rt-extension-assets.git/commit/?h=dom/run_test_suite&id=c8b57fa9fe83ad0afc3adb25f17d4e376177890a

The most ugly. In particular this patch masks the real value of
$RT::VERSION. This could be hacked around with more layers of module
loading (to extra just $RT::VERSION from the installed RT::Generated)
and is clearly Debian-specific. I suspect a better solution would be to
find the installed RT::Generated, and then mangle it automatically to
change $VarPath, $MasonDataDir and $MasonSessionDir. Such an approach
could be moved out into RTx::Module::Install and then reused in a generic
fashion (obviously, enabled via an environment variable).

After all that, the test suite of RT-Extension-Assets passes when
invoked as:

perl Makefile.PL
RT_TEST_DB_TYPE=SQLite make test-parallel

I'd certainly be keen to see the test suites being run as a matter of
course in extensions, and this work looks as though it would be useful
outside the Debian contexts. At the moment unless I'm mistaken it appears
the test suites aren't really usable unless you've also got an installed
version of RT the test suite whose database the test suite is allowed to
poke at directly.

I'd be grateful for any thoughts people have about whether I'm going
down the right path, and whether patches with the modifications
suggested would be likely to be accepted upstream.

Cheers,
Dominic.

_______________________________________________
pkg-request-tracker-maintainers mailing list
pkg-request-tracker-maintainers at lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-request-tracker-maintainers


----- End forwarded message -----



More information about the pkg-request-tracker-maintainers mailing list