Comments (13)
Until we implement that though, do you think it would be possible in the testing environment to disable filesystem compression for the test files? They should all be created in
/tmp/diskonaut_tests
. As I understand it this should make them pass. What do you think?
I fear I do not have that much control over the builders ;). But disabling tests until actual-file-size
is added should work fine, we'll add a comment to the package derivation that reminds someone to check this for future version bumps.
from diskonaut.
Opened: #56
After that is implemented, I'll do some work to make the tests run with the new flag. It will mostly involve changing fixture file sizes.
Let's leave this issue open and close it once all of this happens. Sounds okay?
from diskonaut.
Hey @danieldk, I implemented and released --apparent-size
in 0.9.0. I also changed the tests to use it instead of counting the blocks on disk. Would you like to check and see if this solves the issue for you?
from diskonaut.
Currently it only results in failing tests. We can build the package without tests, but it would be nice if we could build it with tests in the future, since it helps catching regressions.
BTW:
du
also reports 'incorrect' (on-disk) sizes on such filesystems. So, if the goal is to be as close todu
andncdu
as possible, it works as expected.
That was definitely a goal I had in mind, in all honesty. :) I figure people would mostly be comparing diskonaut to these utilities, and that diskonaut would have to explain itself first if it's the one doing something differently.
Maybe one solution for the tests would be to use
Metadata::len
(so that the reported sizes are the same on every filesystem). Perhaps this could even be a command-line flag ofdiskonaut
, to report the actual data sizes rather than the on-disk sizes?
I think that's the best solution. I think other utilities (eg. dust
) have an acutal-file-size
flag that one can pass to get this behaviour.
I looked a little bit into the possibility of disabling compression for the test files or folders, but I think having the tests detect the file system and then do the right thing (depending on whether its zfs, btrfs, etc.) is a bit of a high order.
I'm going to open another issue for the actual-file-size
flag. Until we implement that though, do you think it would be possible in the testing environment to disable filesystem compression for the test files? They should all be created in /tmp/diskonaut_tests
. As I understand it this should make them pass. What do you think?
from diskonaut.
Test results for 0.9.0 on Nix/NixOS
diskonaut> running 40 tests
diskonaut> test tests::cases::ui::empty_folder ... ok
diskonaut> test tests::cases::ui::eleven_files ... ok
diskonaut> test tests::cases::ui::delete_file_press_n ... ok
diskonaut> test tests::cases::ui::clear_selection_when_moving_off_screen_edges ... ok
diskonaut> test tests::cases::ui::cant_delete_file_with_term_too_small ... ok
diskonaut> test tests::cases::ui::enter_folder_medium_width ... ok
diskonaut> test tests::cases::ui::enter_folder ... ok
diskonaut> test tests::cases::ui::files_with_size_zero ... ok
diskonaut> test tests::cases::ui::delete_file ... ok
diskonaut> test tests::cases::ui::enter_largest_folder_with_no_selected_tile ... ok
diskonaut> test tests::cases::ui::delete_folder ... ok
diskonaut> test tests::cases::ui::delete_folder_with_multiple_children ... ok
diskonaut> test tests::cases::ui::enter_folder_small_width ... ok
diskonaut> test tests::cases::ui::medium_width ... ok
diskonaut> test tests::cases::ui::delete_folder_small_window ... ok
diskonaut> test tests::cases::ui::cannot_move_into_small_files ... ok
diskonaut> test tests::cases::ui::minimum_tile_sides ... ok
diskonaut> test tests::cases::ui::pressing_delete_with_no_selected_tile ... ok
diskonaut> test tests::cases::ui::esc_to_go_up ... ok
diskonaut> test tests::cases::ui::move_down_and_enter_folder ... ok
diskonaut> test tests::cases::ui::move_right_and_enter_folder ... ok
diskonaut> test tests::cases::ui::move_left_and_enter_folder ... ok
diskonaut> test tests::cases::ui::small_width ... ok
diskonaut> test tests::cases::ui::noop_when_entering_file ... ok
diskonaut> test tests::cases::ui::too_small_height ... ok
diskonaut> test tests::cases::ui::too_small_width_five ... ok
diskonaut> test tests::cases::ui::move_up_and_enter_folder ... ok
diskonaut> test tests::cases::ui::too_small_width_four ... ok
diskonaut> test ui::format::truncate::tests::truncate_middle_char_boundary ... ok
diskonaut> test tests::cases::ui::too_small_width_one ... ok
diskonaut> test tests::cases::ui::too_small_width_three ... ok
diskonaut> test tests::cases::ui::small_width_long_folder_name ... ok
diskonaut> test tests::cases::ui::too_small_width_two ... ok
diskonaut> test tests::cases::ui::permission_denied_when_deleting ... ok
diskonaut> test tests::cases::ui::small_files_with_y_as_zero ... ok
diskonaut> test tests::cases::ui::small_files ... ok
diskonaut> test tests::cases::ui::two_large_files_one_small_file ... ok
diskonaut> test tests::cases::ui::small_files_with_x_as_zero ... ok
diskonaut> test tests::cases::ui::noop_when_pressing_esc_at_base_folder ... ok
diskonaut> test tests::cases::ui::zoom_into_small_files ... ok
diskonaut> test result: ok. 40 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
diskonaut> installing
diskonaut> post-installation fixup
diskonaut> shrinking RPATHs of ELF executables and libraries in /nix/store/r4xriawrpyj5j8dygc50j8gij94ix5yf-diskonaut-0.9.0
diskonaut> shrinking /nix/store/r4xriawrpyj5j8dygc50j8gij94ix5yf-diskonaut-0.9.0/bin/diskonaut
diskonaut> strip is /nix/store/ydk00ssq4fyx78rpmdmq1hcmz0iw575f-binutils-2.31.1/bin/strip
diskonaut> stripping (with command strip and flags -S) in /nix/store/r4xriawrpyj5j8dygc50j8gij94ix5yf-diskonaut-0.9.0/bin
diskonaut> patching script interpreter paths in /nix/store/r4xriawrpyj5j8dygc50j8gij94ix5yf-diskonaut-0.9.0
diskonaut> checking for references to /build/ in /nix/store/r4xriawrpyj5j8dygc50j8gij94ix5yf-diskonaut-0.9.0...
Nix expression for 0.9.0
{ stdenv, rustPlatform, fetchFromGitHub }:
rustPlatform.buildRustPackage rec {
pname = "diskonaut";
version = "0.9.0";
src = fetchFromGitHub {
owner = "imsnif";
repo = "diskonaut";
rev = "${version}";
sha256 = "125ba9qwh7j8bz74w2zbw729s1wfnjg6dg8yicqrp6559x9k7gq5";
};
cargoSha256 = "0vvbrlmviyn9w8i416767vhvd1gqm3qjvia730m0rs0w5h8khiqf";
meta = with stdenv.lib; {
description = "Terminal disk space navigator";
homepage = "https://github.com/imsnif/diskonaut";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ evanjs ];
};
}
Note that there are no longer any modifications needed for the checkPhase
(which runs tests and etc) :D
Thank you!
I'll make a PR to bump this and remove the special handling for the nix expression.
from diskonaut.
Awesome. If one of you would also like to make a PR to this repo with installation instructions for nix, it would be very welcome. :)
from diskonaut.
Thanks for reporting this @danieldk! @Freaky, I think we briefly touched on this before. Do you think there is a workaround for this?
from diskonaut.
Ah, that makes way more sense. F2FS here, also failing.
Assuming @iblech was on ext4 or similar (re NixOS/nixpkgs#91460 (comment))
from diskonaut.
Did you consider usig Metadata::len
?
Of course, it depends on the goal, is it diskonaut's goal to report the file sizes or what they use on disk (e.g. after compression)? I would guess the former, though I can see why the latter would be useful.
from diskonaut.
Hey @danieldk, I see diskonaut as primarily a tool that helps you clear space up on the hard-drive. Which is why I opted to show how much space it takes up on the hard-drive (also, for compatibility with tools such as du which do the same).
As I understood from a discussion we had here: #26, finding out the compressed file size on disk for filesystems with compression is not trivial (and potentially a little slow). I think @Freaky has an issue to investigate this.
Until then though, we could either:
- Detect filesystem compression somehow and then decide to use
Metadata::len
for them as you suggest - Detect these filesystems in our tests and then make the tests do the right thing
Before we talk about these solutions from a UX perspective, I'd like to understand if this is a blocker for you? I'm not familiar with nix and its requirements. Can you help me understand what this means in this case?
P.S.
Does du actually do the same for these filesystems or not? Maybe my expectations are off. :)
from diskonaut.
Hey @danieldk, I see diskonaut as primarily a tool that helps you clear space up on the hard-drive. Which is why I opted to show how much space it takes up on the hard-drive
I see, makes a lot of sense!
Before we talk about these solutions from a UX perspective, I'd like to understand if this is a blocker for you? I'm not familiar with nix and its requirements. Can you help me understand what this means in this case?
Currently it only results in failing tests. We can build the package without tests, but it would be nice if we could build it with tests in the future, since it helps catching regressions.
BTW: du
also reports 'incorrect' (on-disk) sizes on such filesystems. So, if the goal is to be as close to du
and ncdu
as possible, it works as expected.
Maybe one solution for the tests would be to use Metadata::len
(so that the reported sizes are the same on every filesystem). Perhaps this could even be a command-line flag of diskonaut
, to report the actual data sizes rather than the on-disk sizes?
from diskonaut.
Yeah, I can probably take a look some time today.
Thank you!
from diskonaut.
Will do, thanks again!
from diskonaut.
Related Issues (20)
- thread 'main' panicked at 'index out of bounds: the len is 3600 but the index is 3600 HOT 12
- Bug: When deleting files or entering folders with multibyte characters, the app might crash
- Feature: implement `--apparent-size` HOT 1
- Bug: Small files hidden from view HOT 7
- Bug: Runaway memory usage when run on large directories HOT 9
- Option to delete without confiration? HOT 2
- failure="0.1" not available, the current version is 0.1.8 HOT 4
- An option not to cross filesystems HOT 1
- most dirs are missing HOT 4
- Feature Request: Give an option to exclude directory HOT 1
- offer prebuild deb files in a ppa
- Update jwalk dependency to 0.6
- aarch64 and armhf doest pass tests ?
- The folder takes up too much space (7091231513.3G) HOT 2
- Feature Request: Ability to not cross filesystem boundaries. HOT 2
- Graphics break down when running over SSH to Windows HOT 1
- Feature: 'explode' a directory
- Numbers aren't adding up
- Feature: option `--ignore` to skip certain directory/directories HOT 2
- OneDrive on-demand - files showing full size
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diskonaut.