Skip to content

Commit eb5188e

Browse files
committed
use named tests
- use - instead of spaces to avoid command line quoting - use -#123 suffix to ref issues
1 parent f3717dd commit eb5188e

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

test/comments.d

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import utils;
22

33
import std.format : format;
44

5-
// existing comment
5+
@("update-comment")
66
unittest
77
{
88
setAPIExpectations(
@@ -29,7 +29,7 @@ Auto-close | Bugzilla | Description
2929
postGitHubHook("dlang_phobos_synchronize_4921.json");
3030
}
3131

32-
// no existing dlang bot comment -> create comment and add bug fix label
32+
@("create-comment")
3333
unittest
3434
{
3535
setAPIExpectations(
@@ -60,8 +60,7 @@ Auto-close | Bugzilla | Description
6060
postGitHubHook("dlang_phobos_synchronize_4921.json");
6161
}
6262

63-
// existing dlang bot comment, but no commits that reference a issue
64-
// -> update comment (without references to Bugzilla)
63+
@("update-comment-without-issue-ref")
6564
unittest
6665
{
6766
setAPIExpectations(
@@ -87,9 +86,7 @@ unittest
8786
postGitHubHook("dlang_phobos_synchronize_4921.json");
8887
}
8988

90-
// existing dlang bot comment, but no commits that reference a issue
91-
// -> update comment (without references to Bugzilla)
92-
// test that we don't create a duplicate comment
89+
@("no-duplicate-comments")
9390
unittest
9491
{
9592
setAPIExpectations(
@@ -115,8 +112,7 @@ unittest
115112
postGitHubHook("dlang_phobos_synchronize_4921.json");
116113
}
117114

118-
// existing dlang bot comment + enhancement bugzilla labels
119-
// -> test that we add an enhancement label (not bug fix)
115+
@("add-enhancement-label")
120116
unittest
121117
{
122118
setAPIExpectations(
@@ -151,8 +147,7 @@ unittest
151147
postGitHubHook("dlang_phobos_synchronize_4921.json");
152148
}
153149

154-
// existing dlang bot comment + existing bugzilla labels
155-
// -> test that we don't resend an enhancement label (#97)
150+
@("do-not-readd-labels-1-#97")
156151
unittest
157152
{
158153
setAPIExpectations(
@@ -178,8 +173,7 @@ unittest
178173
postGitHubHook("dlang_phobos_synchronize_4921.json");
179174
}
180175

181-
// existing dlang bot comment -> update comment
182-
// auto-merge label -> remove (due to synchronization)
176+
@("remove-auto-merge-on-sync")
183177
unittest
184178
{
185179
setAPIExpectations(
@@ -205,7 +199,7 @@ unittest
205199
postGitHubHook("dlang_phobos_synchronize_4921.json");
206200
}
207201

208-
// send merge event
202+
@("send-merge-event")
209203
unittest
210204
{
211205
setAPIExpectations(
@@ -216,7 +210,7 @@ unittest
216210
postGitHubHook("dlang_phobos_merged_4963.json");
217211
}
218212

219-
// critical bug fix (not in stable) -> show warning to target stable
213+
@("redirect-critical-fixes-to-stable")
220214
unittest
221215
{
222216
setAPIExpectations(
@@ -264,7 +258,7 @@ Auto-close | Bugzilla | Description
264258
postGitHubHook("dlang_phobos_synchronize_4921.json");
265259
}
266260

267-
// contributors should see a different hello world message
261+
@("hello-world-for-contributors")
268262
unittest
269263
{
270264
setAPIExpectations(
@@ -286,8 +280,7 @@ unittest
286280
postGitHubHook("dlang_phobos_synchronize_4921.json");
287281
}
288282

289-
// check that the bot doesn't send duplicate labels (#112)
290-
// phobos/pull/5519 has the "Bug Fix" label already
283+
@("do-not-readd-labels-2-#112")
291284
unittest
292285
{
293286
setAPIExpectations(
@@ -312,8 +305,7 @@ unittest
312305
postGitHubHook("dlang_phobos_synchronize_5519.json");
313306
}
314307

315-
// check that the bot doesn't send duplicate labels (#112)
316-
// phobos/pull/5519 has the "Bug Fix" label already
308+
@("do-not-readd-labels-3-#112")
317309
unittest
318310
{
319311
setAPIExpectations(
@@ -335,7 +327,7 @@ unittest
335327
postGitHubHook("dlang_phobos_edit_5519.json");
336328
}
337329

338-
// #119 - don't edit the comment for closed PRs
330+
@("do-not-comment-closed-prs-#119")
339331
unittest
340332
{
341333
setAPIExpectations(
@@ -351,7 +343,7 @@ unittest
351343
});
352344
}
353345

354-
// #138 - don't show stable warning for PRs that don't close an issue
346+
@("redirect-only-fixes-to-stable-#138")
355347
unittest
356348
{
357349
setAPIExpectations(
@@ -380,7 +372,7 @@ unittest
380372
postGitHubHook("dlang_phobos_synchronize_4921.json");
381373
}
382374

383-
// #138 - don't show stable warning for PRs with closed issues
375+
@("redirect-only-closing-fixes-to-stable-#138")
384376
unittest
385377
{
386378
setAPIExpectations(
@@ -411,7 +403,7 @@ unittest
411403
postGitHubHook("dlang_phobos_synchronize_4921.json");
412404
}
413405

414-
// Remove old labels on push
406+
@("remove-review-labels-on-push")
415407
unittest
416408
{
417409
import std.array : replace;

0 commit comments

Comments
 (0)