Skip to content

Conversation

@KengoWada
Copy link
Owner

Proposed changes

This PR introduces several improvements and testing utilities for the task management framework:

  • Add HandlerRegistry type
    Simplifies and improves clarity for managing task handlers by introducing a dedicated type alias for the handler map.
  • Add MockWorker
    Provides a mock implementation of the Worker interface to facilitate unit testing of the Manager. It respects context cancellation and integrates with sync.WaitGroup for shutdown tracking.
  • Add accessor methods to Manager
    Adds Workers() and BackoffPolicy() methods to the Manager struct to expose internal components for testing and inspection while maintaining encapsulation.
  • Add TestManager
    Introduces a new test suite focused on validating the behavior of Manager, including task publishing, worker lifecycle, and proper interaction with the broker and backoff policy.

Related issue(s)

Fixes #10

Checklist

Please ensure that the following checks have been performed:

  • I have read and followed the project's contributing guidelines.
  • My code follows the project's coding style.
  • I have added or updated relevant documentation.
  • I have added or updated tests (if applicable).
  • All new and existing tests pass.
  • My changes do not introduce any new warnings or errors.

@KengoWada KengoWada self-assigned this Apr 29, 2025
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.04%. Comparing base (4dd76b0) to head (ddf1247).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop      #13       +/-   ##
============================================
+ Coverage    41.95%   81.04%   +39.08%     
============================================
  Files            4        4               
  Lines          143      153       +10     
============================================
+ Hits            60      124       +64     
+ Misses          83       29       -54     

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

@KengoWada KengoWada merged commit 83adf9f into develop Apr 29, 2025
2 checks passed
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.

[TEST] - Add Tests for Manager Component

3 participants