Skip to content

Commit

Permalink
use named tests
Browse files Browse the repository at this point in the history
- use - instead of spaces to avoid command line quoting
- use -dlang#123 suffix to ref issues
  • Loading branch information
MartinNowak committed Jan 15, 2018
1 parent 8dbd7b3 commit b22092c
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions test/comments.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import utils;

import std.format : format;

// existing comment
@("update-comment")
unittest
{
setAPIExpectations(
Expand All @@ -29,7 +29,7 @@ Auto-close | Bugzilla | Description
postGitHubHook("dlang_phobos_synchronize_4921.json");
}

// no existing dlang bot comment -> create comment and add bug fix label
@("create-comment")
unittest
{
setAPIExpectations(
Expand Down Expand Up @@ -60,8 +60,7 @@ Auto-close | Bugzilla | Description
postGitHubHook("dlang_phobos_synchronize_4921.json");
}

// existing dlang bot comment, but no commits that reference a issue
// -> update comment (without references to Bugzilla)
@("update-comment-without-issue-ref")
unittest
{
setAPIExpectations(
Expand All @@ -87,9 +86,7 @@ unittest
postGitHubHook("dlang_phobos_synchronize_4921.json");
}

// existing dlang bot comment, but no commits that reference a issue
// -> update comment (without references to Bugzilla)
// test that we don't create a duplicate comment
@("no-duplicate-comments")
unittest
{
setAPIExpectations(
Expand All @@ -115,8 +112,7 @@ unittest
postGitHubHook("dlang_phobos_synchronize_4921.json");
}

// existing dlang bot comment + enhancement bugzilla labels
// -> test that we add an enhancement label (not bug fix)
@("add-enhancement-label")
unittest
{
setAPIExpectations(
Expand Down Expand Up @@ -151,8 +147,7 @@ unittest
postGitHubHook("dlang_phobos_synchronize_4921.json");
}

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

// existing dlang bot comment -> update comment
// auto-merge label -> remove (due to synchronization)
@("remove-auto-merge-on-sync")
unittest
{
setAPIExpectations(
Expand All @@ -205,7 +199,7 @@ unittest
postGitHubHook("dlang_phobos_synchronize_4921.json");
}

// send merge event
@("send-merge-event")
unittest
{
setAPIExpectations(
Expand All @@ -216,7 +210,7 @@ unittest
postGitHubHook("dlang_phobos_merged_4963.json");
}

// critical bug fix (not in stable) -> show warning to target stable
@("redirect-critical-fixes-to-stable")
unittest
{
setAPIExpectations(
Expand Down Expand Up @@ -264,7 +258,7 @@ Auto-close | Bugzilla | Description
postGitHubHook("dlang_phobos_synchronize_4921.json");
}

// contributors should see a different hello world message
@("hello-world-for-contributors")
unittest
{
setAPIExpectations(
Expand All @@ -286,8 +280,7 @@ unittest
postGitHubHook("dlang_phobos_synchronize_4921.json");
}

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

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

// #119 - don't edit the comment for closed PRs
@("do-not-comment-closed-prs-#119")
unittest
{
setAPIExpectations(
Expand All @@ -351,7 +343,7 @@ unittest
});
}

// #138 - don't show stable warning for PRs that don't close an issue
@("redirect-only-fixes-to-stable-#138")
unittest
{
setAPIExpectations(
Expand Down Expand Up @@ -380,7 +372,7 @@ unittest
postGitHubHook("dlang_phobos_synchronize_4921.json");
}

// #138 - don't show stable warning for PRs with closed issues
@("redirect-only-closing-fixes-to-stable-#138")
unittest
{
setAPIExpectations(
Expand Down Expand Up @@ -411,7 +403,7 @@ unittest
postGitHubHook("dlang_phobos_synchronize_4921.json");
}

// Remove old labels on push
@("remove-review-labels-on-push")
unittest
{
import std.array : replace;
Expand Down

0 comments on commit b22092c

Please sign in to comment.