Skip to content

Remove hard-coded du tests #330

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

Open
jeromekelleher opened this issue Mar 10, 2025 · 2 comments
Open

Remove hard-coded du tests #330

jeromekelleher opened this issue Mar 10, 2025 · 2 comments

Comments

@jeromekelleher
Copy link
Contributor

Current tests/test_core.py::test_du test is very stupid. Refactor.

jeromekelleher added a commit to jeromekelleher/bio2zarr that referenced this issue Mar 10, 2025
jeromekelleher added a commit to jeromekelleher/bio2zarr that referenced this issue Mar 10, 2025
jeromekelleher added a commit to jeromekelleher/bio2zarr that referenced this issue Mar 10, 2025
@jeromekelleher
Copy link
Contributor Author

This is more complicated that I thought, and I now realise there's a good reason I did things the way I did in the first place. As we see in #331, for some reason getting the du results on CI to agree is hard. It works fine on my machine, so I can only assume it's something to do with the file system on the CI runners. I've tried moving the files to /tmp, but that didn't work either.

I would be most grateful if someone could figure this one out!

@tomwhite
Copy link
Contributor

What we really want to do is test the implementation of du. So test it on a fixed set of files, perhaps generated in the test - to avoid the problem of having to update the numbers every time we add more test data.

But Unix du is problematic in itself as a measure of file sizes since it depends on the way data is laid out by the underlying filesystem (see e.g. https://unix.stackexchange.com/a/106290), so perhaps we shouldn't worry too much about trying to get an exact bytes match - the test could have a tolerance? Or have you tried using du --apparent-size?

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

No branches or pull requests

2 participants