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: Extract pieces to make them more testable #66

Merged
merged 17 commits into from
Jan 19, 2022
Merged

Conversation

carols10cents
Copy link
Contributor

Connects to #49 .

This set of commits attempts to refactor some of the retry code to allow for mocking and unit testing, as well as some code reuse. I highly recommend reviewing commit-by-commit.

Names of the extracted methods are Friday-afternoon quality and should be changed to whatever everyone likes, assuming that you like the direction of these refactorings.

There's absolutely more that can be done here, but this is as far as Jake and I got today. Do you like this? 🥺 👉🏻 👈🏻

@carols10cents carols10cents force-pushed the cn/testability branch 2 times, most recently from 13c54c2 to d79197d Compare January 14, 2022 21:53
Copy link
Collaborator

@crepererum crepererum left a comment

Choose a reason for hiding this comment

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

I like it and I think it's the way to go. I guess we need to improve the interface / trait documentation over time. Let's not get this PR too big. If you're happy with the names and docs, I think you can already merge it and start a new one with a new series of patches.

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

I like, I like a lot 😄

Some minor naming niggles

src/backoff.rs Show resolved Hide resolved
src/backoff.rs Outdated Show resolved Hide resolved
src/connection.rs Outdated Show resolved Hide resolved
@carols10cents carols10cents added the automerge Instruct kodiak to merge the PR label Jan 19, 2022
@kodiakhq kodiakhq bot merged commit 4a03dba into main Jan 19, 2022
@carols10cents carols10cents deleted the cn/testability branch January 19, 2022 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Instruct kodiak to merge the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants