-
Notifications
You must be signed in to change notification settings - Fork 209
Add tests for limits #649
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
Add tests for limits #649
Conversation
I should be able to look at this in the next couple of days @jyn514. |
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.
Sorry for the really long lead time on this fairly small review... 😓
This looks good to me. The tests are easy to follow and cover the essential cases.
Just a small note would be: the display_limits
test does not test all the different labels related to converting bytes into MB etc. We can improve the coverage by testing more unit values.
A simple change would be to tweak the test a bit to, for instance, pick a size of the build log in KB and the value of available RAM in GB? Alternatively, we could also write a test for scale
specifically.
This also rounds to the closest value instead of truncating.
Good idea! I added a test for |
Yeah, makes sense! Having one digit after the decimal point provides a lot more precision. There is a significant difference between |
Implemented fractional precision up to 1 decimal point. I also displayed it as an integer if the decimal was 0 (2.0 -> 2). |
Co-Authored-By: Koenraad Verheyden <[email protected]>
But overall this looks neat 👍 I love Rust's |
Rust is indeed wonderful! Thanks for the review, I think the new precision will be helpful :) |
We had a queue backup this morning because the builder would panic whenever a crate had limits set (#648, https://docs.rs/releases/queue). This adds tests so that doesn't happen again.
r? @kvrhdn