Skip to content

test: increase code coverage from 65% to 70%#385

Draft
mwbrooks wants to merge 4 commits intomainfrom
mwbrooks-test-coverage-simple
Draft

test: increase code coverage from 65% to 70%#385
mwbrooks wants to merge 4 commits intomainfrom
mwbrooks-test-coverage-simple

Conversation

@mwbrooks
Copy link
Member

Changelog

  • N/A

Summary

This pull request attempts to increase our test coverage closer to 70% by focusing on files that do not require mocks or refactors to be tested.

  • Added new test files: context getters/setters, recursive copy, image processing, archive utilities, API collaborators, prompt permissions, and datastore queries.
  • Extended existing test files: activity formatting, survey configs, error handling, style functions, version management, OS wrappers, and HTTP client options.
  • Fix a typo in internal/pkg/platform/activity.go where the deployment activity string produced "deployd" instead of "deployed" and caused a linter warning for the test-case.

Requirements

Add and extend unit tests across the codebase to improve overall test
coverage. New test files cover context getters/setters, recursive copy,
image processing, archive utilities, API collaborators, and prompt
permissions. Extended tests cover activity formatting, survey configs,
error handling, style functions, version management, OS wrappers, HTTP
client options, and datastore bulk operations.
- Fix format string in functionDeploymentToString producing "deployd" instead of "deployed"
- Handle unchecked error return from cmd.Flags().Set() in flags_test.go
- Update test expectation to match corrected deployment string
@mwbrooks mwbrooks added this to the Next Release milestone Mar 11, 2026
@mwbrooks mwbrooks self-assigned this Mar 11, 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 11, 2026
@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.78%. Comparing base (d1f659d) to head (b6186e8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #385      +/-   ##
==========================================
+ Coverage   65.41%   69.78%   +4.37%     
==========================================
  Files         214      214              
  Lines       17847    17847              
==========================================
+ Hits        11674    12455     +781     
+ Misses       5087     4234     -853     
- Partials     1086     1158      +72     

☔ 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.

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