@@ -112,6 +112,39 @@ unittest
112112 postGitHubHook(" dlang_phobos_synchronize_4921.json" );
113113}
114114
115+ // existing dlang bot comment + enhancement bugzilla labels
116+ // -> test that we add an enhancement label (not bug fix)
117+ unittest
118+ {
119+ setAPIExpectations(
120+ " /github/repos/dlang/phobos/pulls/4921/commits" , (ref Json j) {
121+ j[0 ][" commit" ][" message" ] = " Fix Issue 8573" ;
122+ },
123+ " /github/repos/dlang/phobos/issues/4921/comments" ,
124+ " /bugzilla/buglist.cgi?bug_id=8573&ctype=csv&columnlist=short_desc,bug_status,resolution,bug_severity,priority" ,
125+ (scope HTTPServerRequest req, scope HTTPServerResponse res){
126+ res.writeBody(
127+ ` bug_id,"short_desc","bug_status","resolution","bug_severity","priority"
128+ 8573,"A simpler Phobos function that returns the index of the mix or max item","NEW","---","enhancement","P2"` );
129+ },
130+ " /github/repos/dlang/phobos/issues/4921/labels" ,
131+ " /github/orgs/dlang/public_members" ,
132+ " /github/repos/dlang/phobos/issues/comments/262784442" ,
133+ (scope HTTPServerRequest req, scope HTTPServerResponse res){
134+ assert (req.method == HTTPMethod.PATCH );
135+ auto body_= req.json[" body" ].get ! string ;
136+ assert (body_.canFind(" @andralex" ));
137+ },
138+ " /github/repos/dlang/phobos/issues/4921/labels" ,
139+ (scope HTTPServerRequest req, scope HTTPServerResponse res){
140+ assert (req.json[].equal([" Enhancement" ]));
141+ },
142+ " /trello/1/search?query=name:%22Issue%208573%22&" ~ trelloAuth,
143+ );
144+
145+ postGitHubHook(" dlang_phobos_synchronize_4921.json" );
146+ }
147+
115148// existing dlang bot comment -> update comment
116149// auto-merge label -> remove (due to synchronization)
117150unittest
@@ -170,9 +203,7 @@ unittest
170203 // no bug fix label, since Issues are only referenced but not fixed according to commit messages
171204 " /github/repos/dlang/phobos/issues/4921/comments" ,
172205 (scope HTTPServerRequest req, scope HTTPServerResponse res){
173- import std.stdio ;
174206 assert (req.method == HTTPMethod.POST );
175- writeln(req.json[" body" ]);
176207 auto expectedComment =
177208` ### Bugzilla references
178209
@@ -184,7 +215,6 @@ Fix | Bugzilla | Description
184215
185216- Regression fixes should always target stable
186217` .format(bugzillaURL);
187- writeln(expectedComment);
188218 assert (req.json[" body" ].get ! string .canFind(expectedComment));
189219 res.writeVoidBody;
190220 },
0 commit comments