@@ -47,11 +47,11 @@ func TestFaultyDoubleRunWait(t *testing.T) {
4747 Timeout : time .Second ,
4848 }
4949
50- err := command .Run (context .Background ())
50+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
5151
5252 assertive .ErrorIsNil (t , err )
5353
54- err = command .Run (context .Background ())
54+ err = command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
5555
5656 assertive .ErrorIs (t , err , com .ErrExecAlreadyStarted )
5757
@@ -73,7 +73,7 @@ func TestFaultyRunDoubleWait(t *testing.T) {
7373 Timeout : time .Second ,
7474 }
7575
76- err := command .Run (context .Background ())
76+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
7777
7878 assertive .ErrorIsNil (t , err )
7979
@@ -99,11 +99,11 @@ func TestFailRun(t *testing.T) {
9999 Binary : "does-not-exist" ,
100100 }
101101
102- err := command .Run (context .Background ())
102+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
103103
104104 assertive .ErrorIs (t , err , com .ErrFailedStarting )
105105
106- err = command .Run (context .Background ())
106+ err = command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
107107
108108 assertive .ErrorIs (t , err , com .ErrExecAlreadyFinished )
109109
@@ -130,7 +130,7 @@ func TestBasicRunWait(t *testing.T) {
130130 Args : []string {"one" },
131131 }
132132
133- err := command .Run (context .Background ())
133+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
134134
135135 assertive .ErrorIsNil (t , err )
136136
@@ -150,7 +150,7 @@ func TestBasicFail(t *testing.T) {
150150 Args : []string {"-c" , "--" , "does-not-exist" },
151151 }
152152
153- err := command .Run (context .Background ())
153+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
154154
155155 assertive .ErrorIsNil (t , err )
156156
@@ -171,7 +171,7 @@ func TestWorkingDir(t *testing.T) {
171171 WorkingDir : dir ,
172172 }
173173
174- err := command .Run (context .Background ())
174+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
175175
176176 assertive .ErrorIsNil (t , err )
177177
@@ -198,7 +198,7 @@ func TestEnvBlacklist(t *testing.T) {
198198 Binary : "env" ,
199199 }
200200
201- err := command .Run (context .Background ())
201+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
202202
203203 assertive .ErrorIsNil (t , err )
204204
@@ -214,7 +214,7 @@ func TestEnvBlacklist(t *testing.T) {
214214 EnvBlackList : []string {"FOO" },
215215 }
216216
217- err = command .Run (context .Background ())
217+ err = command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
218218
219219 assertive .ErrorIsNil (t , err )
220220
@@ -238,7 +238,8 @@ func TestEnvBlacklist(t *testing.T) {
238238 EnvBlackList : []string {"*" },
239239 }
240240
241- err = command .Run (context .Background ())
241+ err = command .Run (context .WithValue (context .Background (), com .LoggerKey , t ))
242+
242243 assertive .ErrorIsNil (t , err )
243244
244245 res , err = command .Wait ()
@@ -263,7 +264,7 @@ func TestEnvAdd(t *testing.T) {
263264 EnvBlackList : []string {"BLED" },
264265 }
265266
266- err := command .Run (context .Background ())
267+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
267268
268269 assertive .ErrorIsNil (t , err )
269270
@@ -285,7 +286,7 @@ func TestStdoutStderr(t *testing.T) {
285286 Args : []string {"-c" , "--" , "printf onstdout; >&2 printf onstderr;" },
286287 }
287288
288- err := command .Run (context .Background ())
289+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
289290
290291 assertive .ErrorIsNil (t , err )
291292
@@ -309,7 +310,7 @@ func TestTimeoutPlain(t *testing.T) {
309310 Timeout : 1 * time .Second ,
310311 }
311312
312- err := command .Run (context .Background ())
313+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
313314
314315 assertive .ErrorIsNil (t , err )
315316
@@ -336,7 +337,7 @@ func TestTimeoutDelayed(t *testing.T) {
336337 Timeout : 1 * time .Second ,
337338 }
338339
339- err := command .Run (context .Background ())
340+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
340341
341342 assertive .ErrorIsNil (t , err )
342343
@@ -372,7 +373,7 @@ func TestPTYStdout(t *testing.T) {
372373
373374 command .WithPTY (false , true , false )
374375
375- err := command .Run (context .Background ())
376+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
376377
377378 assertive .ErrorIsNil (t , err )
378379
@@ -403,7 +404,7 @@ func TestPTYStderr(t *testing.T) {
403404
404405 command .WithPTY (false , false , true )
405406
406- err := command .Run (context .Background ())
407+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
407408
408409 assertive .ErrorIsNil (t , err )
409410
@@ -432,7 +433,7 @@ func TestPTYBoth(t *testing.T) {
432433
433434 command .WithPTY (true , true , true )
434435
435- err := command .Run (context .Background ())
436+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
436437
437438 assertive .ErrorIsNil (t , err )
438439
@@ -465,7 +466,7 @@ func TestWriteStdin(t *testing.T) {
465466 command .Feed (strings .NewReader ("hello world\n " ))
466467 command .Feed (strings .NewReader ("hello again\n " ))
467468
468- err := command .Run (context .Background ())
469+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
469470
470471 assertive .ErrorIsNil (t , err )
471472
@@ -500,7 +501,7 @@ func TestWritePTYStdin(t *testing.T) {
500501 command .Feed (strings .NewReader ("hello world" ))
501502 command .Feed (strings .NewReader ("hello again" ))
502503
503- err := command .Run (context .Background ())
504+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
504505
505506 assertive .ErrorIsNil (t , err )
506507
@@ -521,7 +522,7 @@ func TestSignalOnCompleted(t *testing.T) {
521522 Timeout : 3 * time .Second ,
522523 }
523524
524- err := command .Run (context .Background ())
525+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
525526
526527 assertive .ErrorIsNil (t , err )
527528
@@ -546,7 +547,7 @@ func TestSignalOnCompleted(t *testing.T) {
546547// Timeout: 3 * time.Second,
547548// }
548549//
549- // err := command.Run(context.Background())
550+ // err := command.Run(context.WithValue(context. Background(), com.LoggerKey, t ))
550551//
551552// assertive.ErrorIsNil(t, err)
552553//
@@ -580,7 +581,7 @@ func TestSignalNormal(t *testing.T) {
580581 Timeout : 3 * time .Second ,
581582 }
582583
583- err := command .Run (context .Background ())
584+ err := command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
584585
585586 assertive .ErrorIsNil (t , err )
586587
@@ -605,7 +606,7 @@ func TestSignalNormal(t *testing.T) {
605606 Timeout : 3 * time .Second ,
606607 }
607608
608- err = command .Run (context .Background ())
609+ err = command .Run (context .WithValue ( context . Background (), com . LoggerKey , t ))
609610
610611 assertive .ErrorIsNil (t , err )
611612
0 commit comments