From aef5cb18c3f2f6e1a438faed08e944af9db4847c Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Sun, 18 Jul 2010 02:12:27 -0700 Subject: Bug 579695: Make xt/search.t do substring tests using a more consistent substring length, thus fixing an intermittent failure that would show up when searching the cf_multi_select field. r=mkanat, a=mkanat (module owner) --- xt/lib/Bugzilla/Test/Search/Constants.pm | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'xt/lib/Bugzilla/Test/Search/Constants.pm') diff --git a/xt/lib/Bugzilla/Test/Search/Constants.pm b/xt/lib/Bugzilla/Test/Search/Constants.pm index 248b59f53..2b3534f8b 100644 --- a/xt/lib/Bugzilla/Test/Search/Constants.pm +++ b/xt/lib/Bugzilla/Test/Search/Constants.pm @@ -48,6 +48,7 @@ our @EXPORT = qw( OR_SKIP PG_BROKEN SKIP_FIELDS + SUBSTR_NO_FIELD_ADD SUBSTR_SIZE TESTS TESTS_PER_RUN @@ -158,22 +159,35 @@ use constant USER_FIELDS => qw( ); # For the "substr"-type searches, how short of a substring should -# we use? +# we use? The goal is to be shorter than the full string, but +# long enough to still be globally unique. use constant SUBSTR_SIZE => 20; # However, for some fields, we use a different size. use constant FIELD_SUBSTR_SIZE => { - alias => 12, - bug_file_loc => 30, + alias => 11, # Just the month and day. deadline => -5, creation_ts => -8, delta_ts => -8, + percentage_complete => 7, work_time => 3, remaining_time => 3, - see_also => 30, - target_milestone => 12, + target_milestone => 15, + longdesc => 25, + # Just the hour and minute. + FIELD_TYPE_DATETIME, -5, }; +# For most fields, we add the length of the name of the field plus +# the SUBSTR_SIZE specified above to determine how large of a substring +# we're going to use. However, for some fields, it doesn't make sense to +# add in their field name this way. +use constant SUBSTR_NO_FIELD_ADD => FIELD_TYPE_DATETIME, qw( + target_milestone remaining_time percentage_complete work_time + attachments.mimetype attachments.submitter attachments.filename + attachments.description flagtypes.name +); + ################ # Known Broken # ################ @@ -364,9 +378,6 @@ use constant KNOWN_BROKEN => { anyexact => { percentage_complete => { contains => [2] }, }, - anywordssubstr => { - percentage_complete => { contains => [2] }, - }, 'allwordssubstr-<1>' => { ALLWORDS_BROKEN }, # flagtypes.name does not work here, probably because they all try to @@ -623,7 +634,7 @@ use constant BROKEN_NOT => { "work_time" => { contains => [1, 2] }, }, 'anywordssubstr-<1> <2>' => { - percentage_complete => { contains => [1,3,4,5] }, + percentage_complete => { contains => [1,2,3,4,5] }, FIELD_TYPE_MULTI_SELECT, { contains => [5] }, }, casesubstring => { -- cgit v1.2.3-24-g4f1b