Skip to content

Commit

Permalink
ci: use root to run make test
Browse files Browse the repository at this point in the history
Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
  • Loading branch information
adamqqqplay authored and bergwolf committed Apr 17, 2024
1 parent 301e93f commit 36cd288
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ jobs:
if: ${{ matrix.arch == 'amd64' }}
run: |
echo user_allow_other | sudo tee --append /etc/fuse.conf
make test
make smoke-all
CARGO_HOME=${HOME}/.cargo
CARGO_BIN=$(which cargo)
sudo -E CARGO=${CARGO_BIN} make test
sudo -E CARGO=${CARGO_BIN} make smoke-all
sudo chown -R $(id -u):$(id -g) "${HOME}/.cargo"
Macos-CI:
runs-on: macos-latest
Expand All @@ -56,7 +59,8 @@ jobs:
sudo installer -pkg fuse-t-macos-installer-1.0.24.pkg -target /
- uses: actions/checkout@v3
- name: build and check
run: make smoke-macos
run: |
make smoke-macos
deny:
name: Cargo Deny
Expand Down
42 changes: 21 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,42 @@ check: build
${CARGO} clippy ${TARGET} --features="fusedev,virtiofs" --no-default-features -- -Dwarnings

test:
cargo test ${TARGET} --features="fusedev" --no-default-features -- --nocapture --skip integration
cargo test ${TARGET} --features="virtiofs" --no-default-features -- --nocapture --skip integration
cargo test ${TARGET} --features="vhost-user-fs" --no-default-features -- --nocapture --skip integration
cargo test ${TARGET} --features="fusedev,virtiofs" --no-default-features -- --nocapture --skip integration
cargo test ${TARGET} --features="fusedev,async-io" --no-default-features -- --nocapture --skip integration
cargo test ${TARGET} --features="virtiofs,async-io" --no-default-features -- --nocapture --skip integration
cargo test ${TARGET} --features="vhost-user-fs,async-io" --no-default-features -- --nocapture --skip integration
cargo test ${TARGET} --features="fusedev,virtiofs,async-io" --no-default-features -- --nocapture --skip integration
cargo test ${TARGET} --features="fusedev,persist" --no-default-features -- --nocapture --skip integration
cargo test ${TARGET} --all-features -- --nocapture --skip integration
${CARGO} test ${TARGET} --features="fusedev" --no-default-features -- --nocapture --skip integration
${CARGO} test ${TARGET} --features="virtiofs" --no-default-features -- --nocapture --skip integration
${CARGO} test ${TARGET} --features="vhost-user-fs" --no-default-features -- --nocapture --skip integration
${CARGO} test ${TARGET} --features="fusedev,virtiofs" --no-default-features -- --nocapture --skip integration
${CARGO} test ${TARGET} --features="fusedev,async-io" --no-default-features -- --nocapture --skip integration
${CARGO} test ${TARGET} --features="virtiofs,async-io" --no-default-features -- --nocapture --skip integration
${CARGO} test ${TARGET} --features="vhost-user-fs,async-io" --no-default-features -- --nocapture --skip integration
${CARGO} test ${TARGET} --features="fusedev,virtiofs,async-io" --no-default-features -- --nocapture --skip integration
${CARGO} test ${TARGET} --features="fusedev,persist" --no-default-features -- --nocapture --skip integration
${CARGO} test ${TARGET} --all-features -- --nocapture --skip integration

smoke:
cargo test ${TARGET} --features="fusedev,persist" -- --nocapture
${CARGO} test ${TARGET} --features="fusedev,persist" -- --nocapture

smoke-all: smoke
cargo test ${TARGET} --features="fusedev,persist" -- --nocapture --ignored
${CARGO} test ${TARGET} --features="fusedev,persist" -- --nocapture --ignored

build-macos:
cargo build --features="fusedev"
cargo build --features="fusedev,fuse-t"
${CARGO} build --features="fusedev"
${CARGO} build --features="fusedev,fuse-t"

check-macos: build-macos
cargo fmt -- --check
cargo clippy --features="fusedev" -- -Dwarnings
cargo test --features="fusedev" -- --nocapture --skip integration
cargo clippy --features="fusedev,fuse-t" -- -Dwarnings
cargo test --features="fusedev,fuse-t" -- --nocapture --skip integration
${CARGO} fmt -- --check
${CARGO} clippy --features="fusedev" -- -Dwarnings
${CARGO} test --features="fusedev" -- --nocapture --skip integration
${CARGO} clippy --features="fusedev,fuse-t" -- -Dwarnings
${CARGO} test --features="fusedev,fuse-t" -- --nocapture --skip integration

smoke-macos: check-macos
cargo test --features="fusedev,fuse-t" -- --nocapture
${CARGO} test --features="fusedev,fuse-t" -- --nocapture

docker-smoke:
docker run --env RUST_BACKTRACE=1 --rm --privileged --volume ${current_dir}:/fuse-rs rust:1.68 sh -c "rustup component add clippy rustfmt; cd /fuse-rs; make smoke-all"

testoverlay:
cd tests/testoverlay && cargo build
cd tests/testoverlay && ${CARGO} build

# Setup xfstests env and run.
xfstests:
Expand Down

0 comments on commit 36cd288

Please sign in to comment.