Commit 7c608a9
committed
test(cmd/ao): replace defer/t.Cleanup os.Chdir with t.Chdir (6 sites, 3 files)
Generator-layer test hygiene cycle. Continues the t.Chdir migration started
in PR #177 (which covered 5 cmd/ao test files: plans, dedup, config,
metrics_flywheel, metrics_health). This cycle picks up disjoint files so
PR #177 and this nightly do not conflict on the same _test.go.
Files migrated (6 sites):
- batch_forge_test.go (3 sites): TestRunForgeBatch_NoPendingTranscripts,
TestRunForgeBatch_DryRunAppliesMaxLimit, TestRunForgeBatch_ProcessesTranscript.
In each, replaces the 4-line block `origDir, err := os.Getwd(); ...
os.Chdir(tmpDir); ...; t.Cleanup(func() { _ = os.Chdir(origDir) })`
with `t.Chdir(tmpDir)`. Subsequent `err = runForgeBatch(...)` becomes
`err := runForgeBatch(...)` (the prior implicit declaration came from
the os.Getwd line).
- batch_promote_test.go (1 site): TestRunBatchPromote_NoPendingCandidates,
same pattern.
- cobra_commands_test.go (2 sites): TestCobraStatusCommand/json_not_initialized
and TestCobraSeedCommand. Pattern is the simpler `defer func() { _ =
os.Chdir(orig) }()` form; collapses to `t.Chdir(...)`.
Net: -32 lines, +0 logic change. `go test -count=1 ./cmd/ao/...` passes;
`go vet ./...` clean; pre-push fast gate passes; full goals measure
unchanged (17 pass / 2 fail — the two open-state failures are
flywheel-compounding W=8 corpus-bound and go-complexity-ceiling W=6
in-flight via PR #177).1 parent 6f41dd5 commit 7c608a9
3 files changed
Lines changed: 8 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
| 497 | + | |
505 | 498 | | |
506 | 499 | | |
507 | 500 | | |
| |||
521 | 514 | | |
522 | 515 | | |
523 | 516 | | |
524 | | - | |
| 517 | + | |
525 | 518 | | |
526 | 519 | | |
527 | 520 | | |
| |||
538 | 531 | | |
539 | 532 | | |
540 | 533 | | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
| 534 | + | |
549 | 535 | | |
550 | 536 | | |
551 | 537 | | |
| |||
602 | 588 | | |
603 | 589 | | |
604 | 590 | | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
| 591 | + | |
613 | 592 | | |
614 | 593 | | |
615 | 594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
| 392 | + | |
400 | 393 | | |
401 | 394 | | |
402 | 395 | | |
| |||
413 | 406 | | |
414 | 407 | | |
415 | 408 | | |
416 | | - | |
| 409 | + | |
417 | 410 | | |
418 | 411 | | |
419 | 412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
588 | | - | |
589 | | - | |
590 | | - | |
| 588 | + | |
591 | 589 | | |
592 | 590 | | |
593 | 591 | | |
| |||
2336 | 2334 | | |
2337 | 2335 | | |
2338 | 2336 | | |
2339 | | - | |
2340 | | - | |
2341 | | - | |
| 2337 | + | |
2342 | 2338 | | |
2343 | 2339 | | |
2344 | 2340 | | |
| |||
0 commit comments