Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
04871c90
You need to sign in or sign up before continuing.
Commit
04871c90
authored
Oct 03, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 601519 - Test pronouns (like %user%, %reporter%, etc.) in xt/search.t
r=mkanat, a=mkanat (module owner)
parent
9936d9f1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
4 deletions
+41
-4
Search.pm
xt/lib/Bugzilla/Test/Search.pm
+9
-3
Constants.pm
xt/lib/Bugzilla/Test/Search/Constants.pm
+26
-1
FieldTest.pm
xt/lib/Bugzilla/Test/Search/FieldTest.pm
+6
-0
No files found.
xt/lib/Bugzilla/Test/Search.pm
View file @
04871c90
...
@@ -592,6 +592,7 @@ sub _create_one_bug {
...
@@ -592,6 +592,7 @@ sub _create_one_bug {
my
$update_alias
=
$self
->
bug_update_value
(
$number
,
'alias'
);
my
$update_alias
=
$self
->
bug_update_value
(
$number
,
'alias'
);
# Otherwise, make bug 6 a clone of bug 1.
# Otherwise, make bug 6 a clone of bug 1.
my
$real_number
=
$number
;
$number
=
1
if
$number
==
6
;
$number
=
1
if
$number
==
6
;
my
$reporter
=
$self
->
bug_create_value
(
$number
,
'reporter'
);
my
$reporter
=
$self
->
bug_create_value
(
$number
,
'reporter'
);
...
@@ -689,9 +690,14 @@ sub _create_one_bug {
...
@@ -689,9 +690,14 @@ sub _create_one_bug {
$update_params
{
groups
}
=
{
add
=>
$update_params
{
groups
},
$update_params
{
groups
}
=
{
add
=>
$update_params
{
groups
},
remove
=>
$bug
->
groups_in
};
remove
=>
$bug
->
groups_in
};
my
@cc_remove
=
map
{
$_
->
login
}
@
{
$bug
->
cc_users
};
my
@cc_remove
=
map
{
$_
->
login
}
@
{
$bug
->
cc_users
};
my
$cc_add
=
$update_params
{
cc
};
my
$cc_new
=
$update_params
{
cc
};
$cc_add
=
[
$cc_add
]
if
!
ref
$cc_add
;
my
@cc_add
=
ref
(
$cc_new
)
?
@$cc_new
:
(
$cc_new
);
$update_params
{
cc
}
=
{
add
=>
$cc_add
,
remove
=>
\
@cc_remove
};
# We make the admin an explicit CC on bug 1 (but not on bug 6), so
# that we can test the %user% pronoun properly.
if
(
$real_number
==
1
)
{
push
(
@cc_add
,
$self
->
admin
->
login
);
}
$update_params
{
cc
}
=
{
add
=>
\
@cc_add
,
remove
=>
\
@cc_remove
};
my
$see_also_remove
=
$bug
->
see_also
;
my
$see_also_remove
=
$bug
->
see_also
;
my
$see_also_add
=
[
$update_params
{
see_also
}];
my
$see_also_add
=
[
$update_params
{
see_also
}];
$update_params
{
see_also
}
=
{
add
=>
$see_also_add
,
$update_params
{
see_also
}
=
{
add
=>
$see_also_add
,
...
...
xt/lib/Bugzilla/Test/Search/Constants.pm
View file @
04871c90
...
@@ -336,6 +336,9 @@ use constant CHANGED_VALUE_BROKEN => (
...
@@ -336,6 +336,9 @@ use constant CHANGED_VALUE_BROKEN => (
# while the other fails. In this case, we have a special override for
# while the other fails. In this case, we have a special override for
# "operator-value", which uniquely identifies tests.
# "operator-value", which uniquely identifies tests.
use
constant
KNOWN_BROKEN
=>
{
use
constant
KNOWN_BROKEN
=>
{
"equals-%group.<1-bug_group>%"
=>
{
commenter
=>
{
contains
=>
[
1
,
2
,
3
,
4
,
5
]
},
},
notequals
=>
{
NEGATIVE_BROKEN
},
notequals
=>
{
NEGATIVE_BROKEN
},
notsubstring
=>
{
NEGATIVE_BROKEN
},
notsubstring
=>
{
NEGATIVE_BROKEN
},
notregexp
=>
{
NEGATIVE_BROKEN
},
notregexp
=>
{
NEGATIVE_BROKEN
},
...
@@ -1262,6 +1265,7 @@ use constant SPECIAL_PARAM_TESTS => (
...
@@ -1262,6 +1265,7 @@ use constant SPECIAL_PARAM_TESTS => (
{
field
=>
'resolution'
,
operator
=>
'anyexact'
,
value
=>
'---'
,
{
field
=>
'resolution'
,
operator
=>
'anyexact'
,
value
=>
'---'
,
contains
=>
[
5
]
},
contains
=>
[
5
]
},
# email* query parameters.
{
field
=>
'assigned_to'
,
operator
=>
'anyexact'
,
{
field
=>
'assigned_to'
,
operator
=>
'anyexact'
,
value
=>
'<1>, <2-reporter>'
,
contains
=>
[
1
,
2
],
value
=>
'<1>, <2-reporter>'
,
contains
=>
[
1
,
2
],
extra_params
=>
{
emailreporter1
=>
1
}
},
extra_params
=>
{
emailreporter1
=>
1
}
},
...
@@ -1270,7 +1274,28 @@ use constant SPECIAL_PARAM_TESTS => (
...
@@ -1270,7 +1274,28 @@ use constant SPECIAL_PARAM_TESTS => (
extra_params
=>
{
extra_params
=>
{
email2
=>
generate_random_password
(
100
),
emaillongdesc2
=>
1
,
email2
=>
generate_random_password
(
100
),
emaillongdesc2
=>
1
,
},
},
}
},
# standard pronouns
{
field
=>
'assigned_to'
,
operator
=>
'equals'
,
value
=>
'%assignee%'
,
contains
=>
[
1
,
2
,
3
,
4
,
5
]
},
{
field
=>
'reporter'
,
operator
=>
'equals'
,
value
=>
'%reporter%'
,
contains
=>
[
1
,
2
,
3
,
4
,
5
]
},
{
field
=>
'qa_contact'
,
operator
=>
'equals'
,
value
=>
'%qacontact%'
,
contains
=>
[
1
,
2
,
3
,
4
,
5
]
},
{
field
=>
'cc'
,
operator
=>
'equals'
,
value
=>
'%user%'
,
contains
=>
[
1
]
},
# group pronouns
{
field
=>
'reporter'
,
operator
=>
'equals'
,
value
=>
'%group.<1-bug_group>%'
,
contains
=>
[
1
,
2
,
3
,
4
,
5
]
},
{
field
=>
'assigned_to'
,
operator
=>
'equals'
,
value
=>
'%group.<1-bug_group>%'
,
contains
=>
[
1
,
2
,
3
,
4
,
5
]
},
{
field
=>
'qa_contact'
,
operator
=>
'equals'
,
value
=>
'%group.<1-bug_group>%'
,
contains
=>
[
1
,
2
,
3
,
4
]
},
{
field
=>
'cc'
,
operator
=>
'equals'
,
value
=>
'%group.<1-bug_group>%'
,
contains
=>
[
1
,
2
,
3
,
4
]
},
{
field
=>
'commenter'
,
operator
=>
'equals'
,
value
=>
'%group.<1-bug_group>%'
,
contains
=>
[
1
,
2
,
3
,
4
,
5
]
},
);
);
1
;
1
;
xt/lib/Bugzilla/Test/Search/FieldTest.pm
View file @
04871c90
...
@@ -431,6 +431,12 @@ sub _translate_value_for_bug {
...
@@ -431,6 +431,12 @@ sub _translate_value_for_bug {
$value
=~
s/<$number-delta>/$bug_delta/g
;
$value
=~
s/<$number-delta>/$bug_delta/g
;
my
$reporter
=
$bug
->
reporter
->
login
;
my
$reporter
=
$bug
->
reporter
->
login
;
$value
=~
s/<$number-reporter>/$reporter/g
;
$value
=~
s/<$number-reporter>/$reporter/g
;
if
(
$value
=~
/<$number-bug_group>/
)
{
my
@bug_groups
=
map
{
$_
->
name
}
@
{
$bug
->
groups_in
};
@bug_groups
=
grep
{
$_
=~
/^\d+-group-/
}
@bug_groups
;
my
$group
=
$bug_groups
[
0
];
$value
=~
s/<$number-bug_group>/$group/g
;
}
my
@bug_values
=
$self
->
bug_values
(
$number
);
my
@bug_values
=
$self
->
bug_values
(
$number
);
return
$value
if
!
@bug_values
;
return
$value
if
!
@bug_values
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment