Closed mweinelt closed 3 years ago
@mweinelt Hey thanks for letting me know!
Something must be off because tests are passing for me locally. Will look into this.
We are running this in a sandboxed environment, so it could be related to that.
@mweinelt I suspect it could be due to missing/bare mime db as handlr
relies on shared mime info.
If you're running this in a Docker container, feel free to share the image you're using and I'll try debugging that.
It is a nix package, so you'd need nix
to test this yourself.
https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/handlr/default.nix
The maintainer disabled the tests for this reason. The sandbox only has a barebones standard environment and the locked cargo dependencies.
I could imagine your tests rely on something like shared-mime-info
, I'm giving this a shot.
And indeed, two more tests work after adding shared-mime-info
during testing. So I kinda expect handlr needs that database at runtime as well?
running 5 tests
test common::desktop_entry::tests::complex_exec ... ok
test apps::user::tests::wildcard_mimes ... FAILED
test common::mime_types::tests::user_input ... ok
test common::mime_types::tests::from_ext ... ok
test common::mime_types::tests::from_path ... ok
failures:
---- apps::user::tests::wildcard_mimes stdout ----
thread 'apps::user::tests::wildcard_mimes' panicked at 'called `Result::unwrap()` on an `Err` value: DirectoryCreationFailed(Os { code: 13, kind: PermissionDenied, message: "Permission denied" })', src/config.rs:28:31
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
apps::user::tests::wildcard_mimes
test result: FAILED. 4 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
error: test failed, to rerun pass '--bin handlr'
Fixed, after I set an appropriate $HOME
environment variable.
@mweinelt
So I kinda expect handlr needs that database at runtime as well?
Yes definitely
Thanks, that made everything work.
I wonder, what prevents you from running cargo test
as a CI step though?
@mweinelt I've already added testing in https://github.com/chmln/handlr/commit/e8d014c113dc3e571150543bc934b56c29bf4407 soon after you opened the issue :)
Thank for the support, I consider this issue resolved.
Running the tests during package update I noticed they fail like this. I also noticed that you don't run
cargo check
during your CI. Why is that?