Skip to content

Commit f293dee

Browse files
committed
Improve logging for tests - output test linenumbers
1 parent 6a90949 commit f293dee

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/utils.d

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,14 @@ void setAPIExpectations(Args...)(Args args)
191191
}
192192

193193
void postGitHubHook(string payload, string eventType = "pull_request",
194-
void delegate(ref Json j, scope HTTPClientRequest req) postprocess = null)
194+
void delegate(ref Json j, scope HTTPClientRequest req) postprocess = null,
195+
int line = __LINE__, string file = __FILE__)
195196
{
196197
import std.file : readText;
197198
import std.path : buildPath;
198199

200+
logInfo("Starting test in %s:%d with payload: %s", file, line, payload);
201+
199202
payload = hookDir.buildPath("github", payload);
200203

201204
auto req = requestHTTP(ghTestHookURL, (scope req) {
@@ -228,14 +231,17 @@ void postGitHubHook(string payload, string eventType = "pull_request",
228231
}
229232

230233
void postTrelloHook(string payload,
231-
void delegate(ref Json j, scope HTTPClientRequest req) postprocess = null)
234+
void delegate(ref Json j, scope HTTPClientRequest req) postprocess = null,
235+
int line = __LINE__, string file = __FILE__)
232236
{
233237
import std.file : readText;
234238
import std.path : buildPath;
235239
import dlangbot.trello : getSignature;
236240

237241
payload = hookDir.buildPath("trello", payload);
238242

243+
logInfo("Starting test in %s:%d with payload: %s", file, line, payload);
244+
239245
auto req = requestHTTP(trelloTestHookURL, (scope req) {
240246
req.method = HTTPMethod.POST;
241247

0 commit comments

Comments
 (0)