From 653bc3973f3134f89920fe50b1d611f5ba1cd0cb Mon Sep 17 00:00:00 2001 From: Xynnn007 Date: Wed, 17 Jul 2024 12:54:31 +0800 Subject: [PATCH] agent: fix make test for kata-agent of dependency anyhow new version of the anyhow crate has changed the backtrace capture thus unit tests of kata-agent that compares a raised error with an expected one would fail. To fix this, we need only panics to have backtraces, thus set `RUST_BACKTRACE=1` and `RUST_LIB_BACKTRACE=0` for tests due to document https://docs.rs/anyhow/latest/anyhow/ Signed-off-by: Xynnn007 --- src/agent/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent/Makefile b/src/agent/Makefile index e0e76a9cd2..e62a894aae 100644 --- a/src/agent/Makefile +++ b/src/agent/Makefile @@ -159,7 +159,7 @@ vendor: #TARGET test: run cargo tests test: $(GENERATED_FILES) - @RUST_LIB_BACKTRACE=0 cargo test --all --target $(TRIPLE) $(EXTRA_RUSTFEATURES) -- --nocapture + @RUST_LIB_BACKTRACE=0 RUST_BACKTRACE=1 cargo test --all --target $(TRIPLE) $(EXTRA_RUSTFEATURES) -- --nocapture ##TARGET check: run test check: $(GENERATED_FILES) standard_rust_check