mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
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:
2
.github/workflows/_rust.yml
vendored
2
.github/workflows/_rust.yml
vendored
@@ -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:
|
||||
|
||||
16
rust/windows-client/scripts/crash-handling-smoke-test.bash
Normal file
16
rust/windows-client/scripts/crash-handling-smoke-test.bash
Normal 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"
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user