project-machine / puzzlefs

Apache License 2.0
380 stars 18 forks source link

Upgrade fastcdc to version 3.0 #67

Closed ariel-miculas closed 1 year ago

hallyn commented 1 year ago

Hm, when I ran 'make test' locally I got:

running 1 test
thread 'build_and_extract_is_noop' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', exe/tests/extract.rs:14:24
stack backtrace:
   0: rust_begin_unwind
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/core/src/result.rs:1791:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/core/src/result.rs:1113:23
   4: extract::build_and_extract_is_noop
             at ./tests/extract.rs:14:5
   5: extract::build_and_extract_is_noop::{{closure}}
             at ./tests/extract.rs:11:32
   6: core::ops::function::FnOnce::call_once
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/core/src/ops/function.rs:507:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/core/src/ops/function.rs:507:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test build_and_extract_is_noop ... FAILED
hallyn commented 1 year ago

But, manually doing a build followed by mount on a busybox container rfs did work.

ariel-miculas commented 1 year ago

@hallyn you need to run docker pull ubuntu:latest for that test to pass, see https://github.com/anuvu/puzzlefs/blob/master/.github/workflows/ci.yaml#L22

hallyn commented 1 year ago

@hallyn you need to run docker pull ubuntu:latest for that test to pass, see https://github.com/anuvu/puzzlefs/blob/master/.github/workflows/ci.yaml#L22

What's this 'docker' thing? (I don't have docker installed)

The testcase should probably be gated on whether docker is installed.

And we could add a testcase which does something along the lines of

which lxc-create || exit 0
lxcname=$(basename $(mktemp -u))
lxc-create -t download -n $lxcname -- -d alpine -r edge -a amd64
dir=$(mkdir -d)
mkdir -p $dir/oci $dir/mnt
export dir
export lxcname
lxc-usernsexec -s -- << "EOF"
unshare -m -- << "XXX"
set -e
puzzlefs create $HOME/.local/share/lxc/$lxcname/rootfs $dir/oci rfs
puzzlefs mount $dir/oci rfs $dir/mnt
test -e $dir/mnt/etc
diff -Nrup $HOME/.local/share/lxc/$lxcname/rootfs $dir/mnt
XXX
EOF
ariel-miculas commented 1 year ago

If we gate the testcase, then one may think all tests have passed, when in fact one test couldn't run. It would be nice if the test could be skipped based on runtime information, but rust doesn't have support for this. Maybe we should move more complex tests out of the unit test framework and run them separately?

hallyn commented 1 year ago

I would turn this around: "make test" is what I would expect to run at the command line. That's the one I'd expect to just run things which can possibly run locally. (The docker test should be listed as "ignored", not "passed", so the user can still see it).

The tests which are run from .github/workflows/ci.yaml could be run with 'make autotest' or something, which fails in those cases.

ariel-miculas commented 1 year ago

We can get rid of docker: https://github.com/anuvu/puzzlefs/issues/68