Skip to content

Commit 8c73c32

Browse files
authored
Clean up justfile and testing (#419)
* Clean up justfile related testing Signed-off-by: Ludvig Liljenberg <[email protected]> * Fix bug where gdb test failed if termianl size was too small, caused by pagination Signed-off-by: Ludvig Liljenberg <[email protected]> --------- Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent 355cdda commit 8c73c32

File tree

7 files changed

+117
-86
lines changed

7 files changed

+117
-86
lines changed

.github/workflows/dep_rust.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
run: just build-and-move-c-guests
8686

8787
- name: Build
88-
run: just build-rust ${{ matrix.config }}
88+
run: just build ${{ matrix.config }}
8989

9090
- name: Verify MSRV
9191
run: ./dev/verify-msrv.sh hyperlight-host hyperlight-guest hyperlight-common
@@ -95,18 +95,18 @@ jobs:
9595
CARGO_TERM_COLOR: always
9696
run: |
9797
# with default features
98-
just test-rust ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv3' && 'mshv3' || ''}}
98+
just test ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv3' && 'mshv3' || ''}}
9999
100100
# with only one driver enabled (driver mshv/kvm feature is ignored on windows) + seccomp + inprocess
101-
just test-rust ${{ matrix.config }} inprocess,seccomp,${{ matrix.hypervisor == 'mshv' && 'mshv2' || matrix.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
101+
just test ${{ matrix.config }} inprocess,seccomp,${{ matrix.hypervisor == 'mshv' && 'mshv2' || matrix.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
102102
103103
# make sure certain cargo features compile
104104
cargo check -p hyperlight-host --features crashdump
105105
cargo check -p hyperlight-host --features print_debug
106106
cargo check -p hyperlight-host --features gdb
107107
108108
# without any driver (shouldn't compile)
109-
just test-rust-feature-compilation-fail ${{ matrix.config }}
109+
just test-compilation-fail ${{ matrix.config }}
110110
111111
# One of the examples is flaky on Windows GH runners, so this allows us to disable it for now
112112
- name: Run Rust examples - windows

Justfile

+103-80
Large diffs are not rendered by default.

src/hyperlight_common/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ hyperlight-testing = { workspace = true }
3131

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

src/hyperlight_host/examples/guest-debugging/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ mod tests {
155155

156156
let mut gdb = Command::new("rust-gdb")
157157
.arg("--nw")
158+
.arg("--batch")
158159
.arg("-x")
159160
.arg(cmd_file_path)
160161
.spawn()

src/hyperlight_host/examples/logging/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ fn fn_writer(_msg: String) -> Result<i32> {
3232
// by Hyperlight will also be emitted as log messages.
3333

3434
fn main() -> Result<()> {
35-
env_logger::init();
35+
env_logger::builder()
36+
.parse_filters("none,hyperlight=info")
37+
.init();
3638
// Get the path to a simple guest binary.
3739
let hyperlight_guest_path =
3840
simple_guest_as_string().expect("Cannot find the guest binary at the expected location.");

src/hyperlight_host/examples/tracing/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ fn main() -> Result<()> {
4242
// Set up the tracing subscriber.
4343
// tracing_forest uses the tracing subscriber, which, by default, will consume logs as trace events
4444
// unless the tracing-log feature is disabled.
45-
let layer = ForestLayer::default().with_filter(EnvFilter::from_default_env());
45+
let layer = ForestLayer::default()
46+
.with_filter(EnvFilter::builder().parse("none,hyperlight=info").unwrap());
4647
Registry::default().with(layer).init();
4748
run_example()
4849
}

src/hyperlight_testing/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ serde_json = "1.0"
1515

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

0 commit comments

Comments
 (0)