From cbd9a76637ca51138447029682dbdfc7bffe90b6 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Sat, 18 Nov 2023 22:52:32 -0300 Subject: [PATCH] improve error report --- .github/workflows/integration-tests.yml | 2 +- crates/updater/tests/update.rs | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index dc9d1a14..1fc6de86 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -26,4 +26,4 @@ jobs: sudo apt-get install -y fuse libfuse2 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - - run: cargo test --test '*' -- --ignored + - run: cargo test --test '*' -- --ignored --nocapture diff --git a/crates/updater/tests/update.rs b/crates/updater/tests/update.rs index aecedacf..6f4d0d5b 100644 --- a/crates/updater/tests/update.rs +++ b/crates/updater/tests/update.rs @@ -247,15 +247,21 @@ fn update_app() { let mut counter = 0; loop { std::thread::sleep(std::time::Duration::from_secs(2)); - if let Ok(o) = binary_cmd - .output() - .map(|o| String::from_utf8_lossy(&o.stdout).to_string()) - { - let version = o.split_once('\n').unwrap().0; - if version == "1.0.0" { - break; + match binary_cmd.output() { + Ok(o) => { + let output = String::from_utf8_lossy(&o.stdout).to_string(); + let version = output.split_once('\n').unwrap().0; + if version == "1.0.0" { + break; + } + println!("unexpected output {output}"); + eprintln!("stderr: {}", String::from_utf8_lossy(&o.stderr)); + } + Err(e) => { + eprintln!("failed to check if app was updated: {e}"); } } + counter += 1; if counter == 10 { panic!("updater test timedout and couldn't verify the update has happened")