ci(windows): test crash handling as part of smoke test (#3624)

If this passes I'll use it to approve #3623
This commit is contained in:
Reactor Scram
2024-02-13 11:12:57 -06:00
committed by GitHub
parent 6c2fdcfd0a
commit bd5b5d9c5f
3 changed files with 19 additions and 0 deletions

View File

@@ -110,6 +110,8 @@ jobs:
run: cargo build -p firezone-windows-client
- name: Run smoke test
run: cargo run -p firezone-windows-client -- smoke-test
- name: Test that the crash handler produces a crash dump
run: bash scripts/crash-handling-smoke-test.bash
# This should be identical to `build-push-windows-release-artifacts` in `cd.yml` except for the Github permissions, needs tag, and uploading step
build-tauri:

View File

@@ -0,0 +1,16 @@
# This script must run from an elevated shell so that Firezone won't try to elevate
set -euo pipefail
BUNDLE_ID="dev.firezone.client"
DUMP_PATH="$LOCALAPPDATA/$BUNDLE_ID/data/logs/last_crash.dmp"
# Delete the crash file if present
rm -f "$DUMP_PATH"
# Ignore the exit code, this is supposed to crash
cargo run -p firezone-windows-client -- --crash || true
# Fail if the crash file wasn't written
stat "$DUMP_PATH"
rm "$DUMP_PATH"

View File

@@ -154,6 +154,7 @@ struct Cli {
command: Option<Cmd>,
/// Crash the `Controller` task to test error handling
/// Formerly `--crash-on-purpose`
#[arg(long, hide = true)]
crash: bool,
/// Error out of the `Controller` task to test error handling