-
Notifications
You must be signed in to change notification settings - Fork 102
use an OffsetDateTime on the ClientStats #244
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I be worried because no tests were changed and, we still have the CI passing? 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally get your concern ahah!
We actually have only one test on this route:
And the
unwrap
right there ensure we were able to parse the new date format:client.get_stats().await.unwrap();
On another note I'm wondering if we could add more tests though, but we can't test a lot of things because we don't know what the
database_size
is supposed to be, we don't really know the time of thelast_update
or what indexes are in theClient
currently 🤔One test we could add though would be to create an index and ensure we find it later in the stats + ensure the time of the
last_update
>= the time we sent our update but that feel like testing meilisearch more than meilisearch-rust, what do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree with that idea! Or maybe if it is possible you could create a mock of the API response, adding a specific value in the
database_size
andlast_update
it will make it easier to test after that. But of course, this mock need only is used in the raw response of the API, to ensure the crate will be able to parse it accordingly.I think this way you could have the whole TDD flow :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a mock would be the best thing, but I don't have the time currently, sadly 😒
We could open an issue, though, I think faux would be really suited for this library 👍