Skip to content

Commit 83799f1

Browse files
peffgitster
authored andcommitted
t9001: use a more distinct fake BugID
In the test "cc list is sanitized", we feed a commit with a variety of trailers to send-email, and then check its output to see how it handled them. For most of them, we are grepping for a specific mention of the header, but there's a "BugID" header which we expect to be ignored. We confirm this by grepping for "12345", the fake BugID, and making sure it is not present. But we can be fooled by false positives! I just tracked down a flaky test failure here that was caused by matching this unrelated line in the output: <[email protected]> which will change from run to run based on the time, pid, etc. Ideally we'd tighten the regex to make this more specifically, but since the point is that it _shouldn't_ be mentioned, it's hard to say what the right match would be (e.g., would there be a leading space?). Instead, let's just choose a match that is much less likely to appear. The actual content of the header isn't important, since it's supposed to be ignored. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 39bf06a commit 83799f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t9001-send-email.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ test_expect_success $PREREQ 'cc list is sanitized' '
13241324
Reviewed-by: Füñný Nâmé <[email protected]>
13251325
Reported-by: bugger on Jira
13261326
Reported-by: Douglas Reporter <[email protected]> [from Jira profile]
1327-
BugID: 12345
1327+
BugID: 12345should-not-appear
13281328
Co-developed-by: "C. O. Developer" <[email protected]>
13291329
Signed-off-by: A. U. Thor <[email protected]>
13301330
EOF
@@ -1337,7 +1337,7 @@ test_expect_success $PREREQ 'cc list is sanitized' '
13371337
" <[email protected]>" actual-show-all-headers &&
13381338
test_grep "^(body) Ignoring Reported-by .* bugger on Jira" actual-show-all-headers &&
13391339
test_grep "^(body) Adding cc: Douglas Reporter <[email protected]>" actual-show-all-headers &&
1340-
test_grep ! "12345" actual-show-all-headers &&
1340+
test_grep ! "12345should-not-appear" actual-show-all-headers &&
13411341
test_grep "^(body) Adding cc: \"C. O. Developer\" <[email protected]>" actual-show-all-headers &&
13421342
test_grep "^(body) Adding cc: \"A. U. Thor\" <[email protected]>" actual-show-all-headers
13431343
'

0 commit comments

Comments
 (0)