New Search Test, Question

Max Kanat-Alexander mkanat at bugzilla.org
Mon Jun 28 01:01:13 UTC 2010


	Hey folks. So, I'm working on a new test for Search.pm, and it's pretty
much an entirely new type of test for Bugzilla--it actually interacts
with an installation's database and proves the correctness of the code
of Search.pm.

	During the test, it writes to the database, and then it rolls back the
transaction at the end. However, this does still modify auto_increment
values and leave some stuff around in bugs_fulltext. So, to protect
installations against running the test if they don't want to modify the
database, I've implemented two safeguards:

	* First, the test is in a separate, new directory, called xt/ (instead
of t/). This is the standard for Perl projects that have "extra tests"
that shouldn't always be run.

	* In order to run any test that modifies the database, an environment
variable BZ_WRITE_TESTS has to be set to some true value.

	Given that these safeguards are in place, do you guys think it's safe
and OK to have the test in Bugzilla's codebase itself, instead of in the
QA tests? The advantage of having it in the codebase itself is that we
can run it continuously against trunk to prove that all Search.pm
changes are correct, and also it will be easily available to developers
and customizers who are working on Search.pm.

	-Max
-- 
http://www.everythingsolved.com/
Competent, Friendly Bugzilla and Perl Services. Everything Else, too.



More information about the developers mailing list