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

timelock: tests the operation store dump #33

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Conversation

MStreet3
Copy link
Collaborator

@MStreet3 MStreet3 commented Feb 6, 2024

Tests that dumping the operation store actually writes the expected values to file. Injects a time faker function and refactors dumpOperationStore to improve testability.

@MStreet3 MStreet3 requested a review from fbac February 6, 2024 14:27
pkg/timelock/scheduler.go Outdated Show resolved Hide resolved

w.Flush()
}
}

// writeOperationStore writes the operations to the writer.
func writeOperationStore(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Now that you extracted the writeOperationStore I think it makes sense for the timelock-worker store to be independent from the timelock-worker itself, so the tw interacts with it via an interface. This is quite a heavy work, so no need to address it here, I'll create an issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed.. I wanted to stop short of that while increasing some test coverage. I think the TODO above would be handled in such an effort to extract the store.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#34

Tests that dumping the operation store actually writes the
expected values to file.  Injects a time faker function and
refactors dumpOperationStore to improve testability.
@MStreet3 MStreet3 merged commit f2a6595 into develop Feb 7, 2024
3 checks passed
@MStreet3 MStreet3 deleted the feat/scheduler-tests branch February 7, 2024 12:16
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