Skip to content

test: increase test coverage for iostreams#394

Open
mwbrooks wants to merge 7 commits intomainfrom
mwbrooks-test-coverage-simple-files-2
Open

test: increase test coverage for iostreams#394
mwbrooks wants to merge 7 commits intomainfrom
mwbrooks-test-coverage-simple-files-2

Conversation

@mwbrooks
Copy link
Member

@mwbrooks mwbrooks commented Mar 12, 2026

Changelog

  • N/A

Summary

This pull request increases the test coverage of our package iostreams and brings our total coverage to 68.24% (+0.35%).

  • Added Maintainer and CLAUDE.md documentation on test case naming and ordering

Requirements

Rename 12 test functions to follow the Test_StructName_FunctionName
and Test_FunctionName naming convention. Document the convention in
MAINTAINERS_GUIDE.md and CLAUDE.md.
Reorder test functions added on this branch alphabetically within
their files, grouping getter/setter tests under the base name.
Document the test ordering convention in MAINTAINERS_GUIDE.md and
CLAUDE.md.
@mwbrooks mwbrooks added this to the Next Release milestone Mar 12, 2026
@mwbrooks mwbrooks self-assigned this Mar 12, 2026
@mwbrooks mwbrooks added code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment labels Mar 12, 2026
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.24%. Comparing base (8e4c0aa) to head (5552c10).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #394      +/-   ##
==========================================
+ Coverage   67.88%   68.24%   +0.35%     
==========================================
  Files         218      218              
  Lines       18090    18090              
==========================================
+ Hits        12281    12345      +64     
+ Misses       4654     4587      -67     
- Partials     1155     1158       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member Author

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments for the patient reviewers! 🔖

"github.com/stretchr/testify/require"
)

func Test_IOStreams_ExitCode(t *testing.T) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Alphabetically ordered as best as we can. 🔤

- Mock the `ClientFactory` and its dependencies for testing
- Always mock file system operations using `afero.Fs` to enable testability

### Test Naming Conventions
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Helping Claude be better 💪🏻

@mwbrooks mwbrooks marked this pull request as ready for review March 12, 2026 21:51
@mwbrooks mwbrooks requested a review from a team as a code owner March 12, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant