kyoheiu / felix

tui file manager with vim-like key mapping
https://kyoheiu.dev/felix/
MIT License
708 stars 24 forks source link

Test failure due to missing `permission_test` file #200

Closed orhun closed 1 year ago

orhun commented 1 year ago

Hey, Arch maintainer of felix here! šŸ‘‹šŸ¼

I'm getting the following test failure while building 2.2.7:

running 13 tests
test functions::tests::test_display_count ... ok
test functions::tests::test_convert_to_permissions ... ok
test functions::tests::test_duration_to_string ... ok
test functions::tests::test_format_time ... ok
test functions::tests::test_proper_size ... ok
test functions::tests::test_list_up_contents ... FAILED
test functions::tests::test_split_str_including_wide_char ... ok
test magic_image::tests::test_inspect_image ... ok
test state::tests::test_has_write_permission ... FAILED
test run::tests::zoxide_test ... ok
test magic_packed::tests::test_inspect_signature ... ok
test state::tests::bench_update_single ... ok
test state::tests::bench_update_parallel ... ok

failures:

---- functions::tests::test_list_up_contents stdout ----
thread 'functions::tests::test_list_up_contents' panicked at 'assertion failed: `(left == right)`
  left: `"ā”œ archives\nā”” images"`,
 right: `"ā”œ archives\nā”œ images\nā”” permission_test"`', src/functions.rs:338:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- state::tests::test_has_write_permission stdout ----
thread 'state::tests::test_has_write_permission' panicked at 'called `Result::unwrap()` on an `Err` value: Io("No such file or directory (os error 2)")', src/state.rs:1754:52

failures:
    functions::tests::test_list_up_contents
    state::tests::test_has_write_permission

test result: FAILED. 11 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s

error: test failed, to rerun pass `--bin fx`

Currently I'm doing the following as a workaround:

touch testfiles/permission_test
chmod 444 testfiles/permission_test

Can you maybe add this file to the repository? Related pull request: #201

kyoheiu commented 1 year ago

Ah, I didn't notice that empty directory is not detectable on remote... with an empty text file, testing with exacl seems doing right. #202

kyoheiu commented 1 year ago

202 merged, now I think you can pass the test. Could you please check?

orhun commented 1 year ago

This time I'm getting this:

running 13 tests
test functions::tests::test_duration_to_string ... ok
test functions::tests::test_convert_to_permissions ... ok
test functions::tests::test_proper_size ... ok
test functions::tests::test_format_time ... ok
test functions::tests::test_display_count ... ok
test functions::tests::test_split_str_including_wide_char ... ok
test functions::tests::test_list_up_contents ... ok
test magic_image::tests::test_inspect_image ... ok
test state::tests::test_has_write_permission ... FAILED
test run::tests::zoxide_test ... FAILED
test magic_packed::tests::test_inspect_signature ... ok
test state::tests::bench_update_single ... ok
test state::tests::bench_update_parallel ... ok

failures:

---- state::tests::test_has_write_permission stdout ----
thread 'state::tests::test_has_write_permission' panicked at 'assertion failed: !has_write_permission(p.as_path()).unwrap()', src/state.rs:1762:9

---- run::tests::zoxide_test stdout ----
thread 'run::tests::zoxide_test' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/run.rs:1703:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    run::tests::zoxide_test
    state::tests::test_has_write_permission

test result: FAILED. 11 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s

error: test failed, to rerun pass `--bin fx`
kyoheiu commented 1 year ago

Thank you for testing. Fix #203 merged:

How about this? (Note that if you run the test as root, test_has_write_permission will fail)

orhun commented 1 year ago

Yeah, that works. šŸ„³ Thanks, closing...