From ec223cfa7bf0a2ce5da63f4bd8e0379d2076ade9 Mon Sep 17 00:00:00 2001 From: Stefano Garzarella Date: Fri, 19 Jan 2024 10:24:36 +0100 Subject: [PATCH] tests: add rust-vmm-ci-tests.json pipeline This is based on `rust-vmm-ci/.buildkite/test_description.json`. We can't run rust-vmm-ci tests because they enable all the features with `--all-features` and our crates have features that may not be compatible with others (e.g. `xen`). Waiting to solve this problem in rust-vmm-ci (see https://github.com/rust-vmm/rust-vmm-ci/issues/152), we use a custom pipeline based on that but that does not use `--all-features`. Signed-off-by: Stefano Garzarella --- .buildkite/README.md | 8 +++ .buildkite/rust-vmm-ci-tests.json | 112 ++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 .buildkite/rust-vmm-ci-tests.json diff --git a/.buildkite/README.md b/.buildkite/README.md index 6d482f06..2fba68d3 100644 --- a/.buildkite/README.md +++ b/.buildkite/README.md @@ -8,3 +8,11 @@ https://buildkite.com/rust-vmm/vhost-ci/steps Custom pipelines currently defined are: - `custom-tests.json` Custom tests to enable only certain features. + +- `rust-vmm-ci-tests.json` + This is based on `rust-vmm-ci/.buildkite/test_description.json`. + We can't run rust-vmm-ci tests because they enable all the features with + `--all-features` and our crates have features that may not be compatible with + others (e.g. `xen`). Waiting to solve this problem in rust-vmm-ci (see + https://github.com/rust-vmm/rust-vmm-ci/issues/152), we use a custom + pipeline based on that but that does not use `--all-features`. diff --git a/.buildkite/rust-vmm-ci-tests.json b/.buildkite/rust-vmm-ci-tests.json new file mode 100644 index 00000000..4fd04852 --- /dev/null +++ b/.buildkite/rust-vmm-ci-tests.json @@ -0,0 +1,112 @@ +{ + "tests": [ + { + "test_name": "build-gnu", + "command": "RUSTFLAGS=\"-D warnings\" cargo build --release", + "platform": [ + "x86_64", + "aarch64" + ] + }, + { + "test_name": "build-musl", + "command": "RUSTFLAGS=\"-D warnings\" cargo build --release --target {target_platform}-unknown-linux-musl", + "platform": [ + "x86_64", + "aarch64" + ] + }, + { + "test_name": "style", + "command": "cargo fmt --all -- --check --config format_code_in_doc_comments=true" + }, + { + "test_name": "unittests-gnu-all-with-xen", + "command": "cargo test --workspace --no-default-features --features test-utils,vhost-vsock,vhost-kern,vhost-vdpa,vhost-net,vhost-user,vhost-user-frontend,vhost-user-backend,xen", + "platform": [ + "x86_64", + "aarch64" + ] + }, + { + "test_name": "unittests-gnu-all-without-xen", + "command": "cargo test --workspace --no-default-features --features test-utils,vhost-vsock,vhost-kern,vhost-vdpa,vhost-net,vhost-user,vhost-user-frontend,vhost-user-backend", + "platform": [ + "x86_64", + "aarch64" + ] + }, + { + "test_name": "unittests-musl-all-with-xen", + "command": "cargo test --workspace --target {target_platform}-unknown-linux-musl --no-default-features --features test-utils,vhost-vsock,vhost-kern,vhost-vdpa,vhost-net,vhost-user,vhost-user-frontend,vhost-user-backend,xen", + "platform": [ + "x86_64", + "aarch64" + ] + }, + { + "test_name": "unittests-musl-all-without-xen", + "command": "cargo test --workspace --target {target_platform}-unknown-linux-musl --no-default-features --features test-utils,vhost-vsock,vhost-kern,vhost-vdpa,vhost-net,vhost-user,vhost-user-frontend,vhost-user-backend", + "platform": [ + "x86_64", + "aarch64" + ] + }, + { + "test_name": "clippy-all-with-xen", + "command": "cargo clippy --workspace --bins --examples --benches --all-targets --no-default-features --features test-utils,vhost-vsock,vhost-kern,vhost-vdpa,vhost-net,vhost-user,vhost-user-frontend,vhost-user-backend,xen -- -D warnings -D clippy::undocumented_unsafe_blocks", + "platform": [ + "x86_64", + "aarch64" + ] + }, + { + "test_name": "clippy-all-without-xen", + "command": "cargo clippy --workspace --bins --examples --benches --all-targets --no-default-features --features test-utils,vhost-vsock,vhost-kern,vhost-vdpa,vhost-net,vhost-user,vhost-user-frontend,vhost-user-backend -- -D warnings -D clippy::undocumented_unsafe_blocks", + "platform": [ + "x86_64", + "aarch64" + ] + }, + { + "test_name": "check-warnings-all-with-xen", + "command": "RUSTFLAGS=\"-D warnings\" cargo check --all-targets --workspace --no-default-features --features test-utils,vhost-vsock,vhost-kern,vhost-vdpa,vhost-net,vhost-user,vhost-user-frontend,vhost-user-backend,xen", + "platform": [ + "x86_64", + "aarch64" + ] + }, + { + "test_name": "check-warnings-all-without-xen", + "command": "RUSTFLAGS=\"-D warnings\" cargo check --all-targets --workspace --no-default-features --features test-utils,vhost-vsock,vhost-kern,vhost-vdpa,vhost-net,vhost-user,vhost-user-frontend,vhost-user-backend", + "platform": [ + "x86_64", + "aarch64" + ] + }, + { + "test_name": "coverage", + "command": "pytest $(find . -type f -name \"test_coverage.py\")", + "docker_plugin": { + "privileged": true + }, + "platform": [ + "x86_64" + ] + }, + { + "test_name": "commit-format", + "command": "pytest $(find . -type f -name \"test_commit_format.py\")", + "docker_plugin": { + "propagate-environment": true + } + }, + { + "test_name": "cargo-audit", + "command": "[ -e Cargo.lock ] || cargo generate-lockfile; cargo audit -q --deny warnings", + "platform": [ + "x86_64" + ] + } + ] +}