Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use channels on TestableActor to be able to verify sent messages #647

Merged
merged 2 commits into from
Mar 6, 2025

Conversation

TypeLevelConsoli
Copy link
Collaborator

TestableActors uses an Arc<Notify> to know when their messages are triggered, but that only notifies a mute signal, no context or message is gathered. By changing it to mpsc::channel instead, we can receive the message passed and compare it to that we sent.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13701998814

Details

  • 33 of 33 (100.0%) changed or added relevant lines in 5 files are covered.
  • 9 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 75.969%

Files with Coverage Reduction New Missed Lines %
crates/tap-agent/src/agent/sender_account.rs 9 75.74%
Totals Coverage Status
Change from base Build 13624709983: 0.05%
Covered Lines: 8425
Relevant Lines: 11090

💛 - Coveralls

Copy link
Collaborator

@suchapalaver suchapalaver left a comment

Choose a reason for hiding this comment

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

Really clear solution, I appreciated how this made the tests themselves more readable 👍

@TypeLevelConsoli TypeLevelConsoli merged commit b24bedc into main Mar 6, 2025
10 checks passed
@TypeLevelConsoli TypeLevelConsoli deleted the refactor-testable-actor branch March 6, 2025 23:49
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.

3 participants