You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: replace t.Skip with t.Skipf throughout codebase (#1449)
* refactor: replace t.Skip with t.Skipf and improve test skipping
- Replace all t.Skip() calls with t.Skipf() providing descriptive reasons
- Update CLI test infrastructure to use skipReason instead of fatal exits
- Add golangci-lint rule to enforce t.Skipf usage
- Update CLAUDE.md with test skipping conventions
- Ensure TestMain always calls m.Run() for proper test reporting
This change improves test debugging by providing clear reasons when tests
are skipped, and ensures that missing/stale binaries result in properly
reported skipped tests rather than fatal exits.
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: add tests.test to .gitignore
* [autofix.ci] apply automated fixes
* fix: re-add forbidigo to test file exclusions
The forbidigo linter needs to be excluded from test files because tests
legitimately need to use os.Getenv and os.Setenv for setting up test
environments. With 223 occurrences across 44 test files, it's not
practical to add nolint comments to each one.
The t.Skip check will still be enforced through code review and the
documented convention in CLAUDE.md.
* docs: fix CLAUDE.md to show t.Skipf in all examples
Updated the test skipping convention examples to consistently use t.Skipf()
instead of t.Skip(), ensuring the documentation matches the actual
implementation and reinforces the correct pattern.
* docs: clarify TestMain must call os.Exit(m.Run()) for proper exit codes
Updated CLAUDE.md to explicitly state that TestMain must call os.Exit(m.Run())
to propagate test exit codes, and clarified that skipReason should be set
before calling m.Run(). This ensures proper test process termination and
exit code propagation.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
0 commit comments