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
Size tests fix #399
Size tests fix #399
Conversation
The translations are provided by libbytesize.
Wow, how did I not notice that libbytesize doesn't use My brain struggles mightily with the idea that Since we are dealing with size quantities here I can see an argument for rounding up in certain situations, but it is still a mental hurdle for me. If the size represents a quantity used, rounding up seems to make sense (so that we do not under-estimate how much we have taken). But what if the size represents a quantity of free space? Rounding up seems to be a bad idea for this (because it leads us to over-estimate how much we have available). And what if we're relating two complementary sizes? Consider a With
With
Which one do you think does a better job of representing the truth? |
Originally I didn't want to set any default because with storage, it's always a bug to rely on some default rounding. That's also why we always specify the rounding mode in Blivet. As for the So what I'm gonna do is:
|
Rounding half up is the most natural rounding mode. It however doesn't make much sense in most of the calculations related to storage so we should try to explain developers that they should think about and specify the rounding mode. Removing the default would change the API.
The tests are gonna fail here because they require the new libbytesize. I'll build and install it on our jenkins slaves once storaged-project/libbytesize#15 gets merged. |
I would be okay with making rounding mode a positional/mandatory argument for |
I had the very same idea. |
Jenkins, please test this. |
Jenkins, please test this again. |
Ran the check manually on the Jenkins slave and all tests passed. |
This should fix the recent failures of tests because of libbytesize's translations being finally in place.