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

Introduce interface mailfilter.Trx and a testing implementation testtrx.Trx #4

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

d--j
Copy link
Owner

@d--j d--j commented Mar 15, 2023

With this new testtrx.Trx users of the mailfilter milter abstraction can easily write unit tests for their decision function. before this refactoring the decision function could not easily be unit tested because generating mailfilter.Transaction structs was not possible outside of this library.

BREAKING CHANGE: the mailfilter signatures changed significantly because we now pass a Trx interface to the decision function instead of a Transaction struct. The changes library users need to do are mostly calling methods instead of accessing public fields of the transaction.

…tion testtrx.Trx

With this new testtrx.Trx users of the mailfilter milter abstraction can easily write unit tests for their decision function. before this refactoring the decision function could not easily be unit tested because generating mailfilter.Transaction structs was not possible outside of this library.

BREAKING CHANGE: the mailfilter signatures changed significantly because we now pass a Trx interface to the decision function instead of a Transaction struct. The changes library users need to do are mostly calling methods instead of accessing public fields of the transaction.
@coveralls
Copy link
Collaborator

Coverage Status

Coverage: 84.724% (-0.5%) from 85.212% when pulling ca43cb2 on testability into 96a68dc on main.

@d--j d--j marked this pull request as ready for review March 15, 2023 19:20
@d--j d--j merged commit b1c7d01 into main Mar 15, 2023
@d--j d--j deleted the testability branch March 15, 2023 19:21
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.

2 participants