Skip to content

Clean up justfile and testing #419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/dep_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
run: just build-and-move-c-guests

- name: Build
run: just build-rust ${{ matrix.config }}
run: just build ${{ matrix.config }}

- name: Verify MSRV
run: ./dev/verify-msrv.sh hyperlight-host hyperlight-guest hyperlight-common
Expand All @@ -95,18 +95,18 @@ jobs:
CARGO_TERM_COLOR: always
run: |
# with default features
just test-rust ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv3' && 'mshv3' || ''}}
just test ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv3' && 'mshv3' || ''}}

# with only one driver enabled (driver mshv/kvm feature is ignored on windows) + seccomp + inprocess
just test-rust ${{ matrix.config }} inprocess,seccomp,${{ matrix.hypervisor == 'mshv' && 'mshv2' || matrix.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
just test ${{ matrix.config }} inprocess,seccomp,${{ matrix.hypervisor == 'mshv' && 'mshv2' || matrix.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}

# make sure certain cargo features compile
cargo check -p hyperlight-host --features crashdump
cargo check -p hyperlight-host --features print_debug
cargo check -p hyperlight-host --features gdb

# without any driver (shouldn't compile)
just test-rust-feature-compilation-fail ${{ matrix.config }}
just test-compilation-fail ${{ matrix.config }}

# One of the examples is flaky on Windows GH runners, so this allows us to disable it for now
- name: Run Rust examples - windows
Expand Down
183 changes: 103 additions & 80 deletions Justfile

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/hyperlight_common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ hyperlight-testing = { workspace = true }

[lib]
bench = false # see https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
doctest = false # reduce noise in test output
1 change: 1 addition & 0 deletions src/hyperlight_host/examples/guest-debugging/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ mod tests {

let mut gdb = Command::new("rust-gdb")
.arg("--nw")
.arg("--batch")
.arg("-x")
.arg(cmd_file_path)
.spawn()
Expand Down
4 changes: 3 additions & 1 deletion src/hyperlight_host/examples/logging/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ fn fn_writer(_msg: String) -> Result<i32> {
// by Hyperlight will also be emitted as log messages.

fn main() -> Result<()> {
env_logger::init();
env_logger::builder()
.parse_filters("none,hyperlight=info")
.init();
// Get the path to a simple guest binary.
let hyperlight_guest_path =
simple_guest_as_string().expect("Cannot find the guest binary at the expected location.");
Expand Down
3 changes: 2 additions & 1 deletion src/hyperlight_host/examples/tracing/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ fn main() -> Result<()> {
// Set up the tracing subscriber.
// tracing_forest uses the tracing subscriber, which, by default, will consume logs as trace events
// unless the tracing-log feature is disabled.
let layer = ForestLayer::default().with_filter(EnvFilter::from_default_env());
let layer = ForestLayer::default()
.with_filter(EnvFilter::builder().parse("none,hyperlight=info").unwrap());
Registry::default().with(layer).init();
run_example()
}
Expand Down
3 changes: 3 additions & 0 deletions src/hyperlight_testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ serde_json = "1.0"

[lib]
bench = false # see https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
# reduce noise in test output
test = false
doctest = false