Skip to content

Conversation

@ncode
Copy link
Owner

@ncode ncode commented Dec 25, 2025

Summary

  • Refactor runCmd from Run to RunE for better testability
  • Extract runElectionWithContext() function for isolated testing
  • Add proper error returns instead of os.Exit(1)
  • Add validation for empty enabled services list
  • Add cmd package tests (root_test.go, run_test.go)
  • Add comprehensive tests for wrapper methods and edge cases

Coverage

  • Before: 69.8% total
  • After: 85.0% total

Test plan

  • All existing tests pass
  • New cmd tests pass
  • New ballot tests pass
  • Race detection passes

🤖 Generated with Claude Code

- Refactor runCmd from Run to RunE for better testability
- Extract runElectionWithContext for isolated testing
- Add proper error returns instead of os.Exit(1)
- Add validation for empty enabled services list
- Add cmd package tests (root_test.go, run_test.go)
- Add comprehensive tests for wrapper methods and edge cases
- Coverage improved from 69.8% to 85.0%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

❌ Patch coverage is 64.28571% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.34%. Comparing base (04bf30f) to head (9c296ad).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
cmd/run.go 64.28% 7 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #25       +/-   ##
===========================================
+ Coverage   57.35%   78.34%   +20.98%     
===========================================
  Files           4        4               
  Lines         469      471        +2     
===========================================
+ Hits          269      369      +100     
+ Misses        168       82       -86     
+ Partials       32       20       -12     

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

@ncode ncode merged commit b5c38e2 into main Dec 25, 2025
5 checks passed
@ncode ncode deleted the juliano/tests branch December 25, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant