Commit 09cc2ee
test(cmd): make step-summary warning test hermetic (#776)
TestRunWarnsOnUnwritableStepSummary was the only test in
cmd/threat-detect that reached the engine invocation without stubbing an
engine on PATH, so it executed whatever real `copilot` binary the host
provided. On a runner with working engine credentials (e.g. inside the
AWF sandbox during the standalone smoke workflows) this starts a live
agentic session that never returns, hanging the package until the 10
minute `go test` timeout and failing `make test`.
Stub a fake copilot for that test, and make runWithTestArgsCapture
default PATH to an empty directory when a test does not set one, so no
future test can silently fall through to a real engine CLI.
Co-authored-by: GitHub Ace <githubnext@users.noreply.github.com>
Co-authored-by: David Slater <12449447+davidslater@users.noreply.github.com>1 parent 0caa4f9 commit 09cc2ee
2 files changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
443 | 450 | | |
444 | 451 | | |
445 | 452 | | |
446 | 453 | | |
447 | 454 | | |
448 | 455 | | |
449 | 456 | | |
| 457 | + | |
450 | 458 | | |
451 | 459 | | |
452 | 460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
429 | 435 | | |
430 | 436 | | |
431 | 437 | | |
| |||
0 commit comments