Skip to content

Commit 75f1e88

Browse files
committed
fix ci tracing tests silently failing
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
1 parent 9a2860a commit 75f1e88

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.github/workflows/dep_rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ jobs:
175175
env:
176176
CARGO_TERM_COLOR: always
177177
RUST_LOG: debug
178-
run: just test-rust-tracing ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv2' && 'mshv2' || ''}}
178+
run: just test-rust-tracing ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
179179

180180
- name: Download benchmarks from "latest"
181181
run: just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu}} dev-latest # compare to prerelease

Justfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,14 @@ test-rust-tracing target=default-target features="":
204204
just build-rust-guests {{ target }} trace_guest
205205
just move-rust-guests {{ target }}
206206
# Run hello-world example with tracing enabled to get the trace output
207-
# Capture the trace file path and print use it afterwards to run cargo run -p trace_dump
208-
cargo run --profile={{ if target == "debug" { "dev" } else { target } }} --example hello-world --features {{ if features =="" {'trace_guest'} else { "trace_guest," + features } }} \
209-
| sed -n 's/.*Creating trace file at: \(.*\)/\1/p' \
210-
| xargs -I {} cargo run -p trace_dump ./{{ simpleguest_source }}/{{ target }}/simpleguest {} list_frames
207+
TRACE_OUTPUT="$(cargo run --profile={{ if target == "debug" { "dev" } else { target } }} --example hello-world --features {{ if features =="" {"trace_guest"} else { "trace_guest," + features } }})" && \
208+
TRACE_FILE="$(echo "$TRACE_OUTPUT" | grep -oE 'Creating trace file at: [^ ]+' | awk -F': ' '{print $2}')" && \
209+
echo "$TRACE_OUTPUT" && \
210+
if [ -z "$TRACE_FILE" ]; then \
211+
echo "Error: Could not extract trace file path from output." >&2 ; \
212+
exit 1 ; \
213+
fi && \
214+
cargo run -p trace_dump ./{{ simpleguest_source }}/{{ target }}/simpleguest "$TRACE_FILE" list_frames
211215

212216
# Rebuild the tracing guests without the tracing feature
213217
# This is to ensure that the tracing feature does not affect the other tests

src/tests/rust_guests/witguest/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)