v0.3.7-pre.010

This commit is contained in:
2026-09-02 18:56:09 +02:00
parent 97f84e5c58
commit 313d2a1ea6
20 changed files with 533 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-backfill-desk/tests/desktop_contract.rs
// version: 11
// version: 12
//! Structural desktop contract checks for the Backfill Desk scaffold.
@@ -346,3 +346,31 @@ fn pre_009_latest_value_monitoring_uses_snapshot_source_event_bridge_and_resynch
assert!(frontend.contains("syncBackfillStatus"));
assert!(!frontend.contains("parseBackfillLog"));
}
#[test]
fn pre_010_cancel_is_targeted_idempotent_and_shutdown_requests_cooperative_cancellation_before_exit() {
let root = app_root();
let state = read_text(root.join("src/app_state.rs").as_path());
let run = read_text(root.join("src/backfill_run.rs").as_path());
let tauri = read_text(root.join("src/tauri.rs").as_path());
let html = read_text(root.join("frontend/main.html").as_path());
let frontend = read_text(root.join("frontend/ts/main.ts").as_path());
assert!(run.contains("current.job_id.as_str() != job_id"));
assert!(run.contains("current.handle.cancel()"));
assert!(run.contains("ERROR_CODE_BACKFILL_RUN_MISMATCH"));
assert!(state.contains("cancel_backfill"));
assert!(state.contains("cancel_active_backfill_for_shutdown"));
assert!(tauri.contains("backfill_cancel"));
assert!(tauri.contains("cancel_active_backfill_for_shutdown"));
let shutdown_cancel = tauri.find("cancel_active_backfill_for_shutdown");
let shutdown_exit = tauri.find("app_handle.exit(0)");
assert!(shutdown_cancel.is_some());
assert!(shutdown_exit.is_some());
if let (std::option::Option::Some(cancel), std::option::Option::Some(exit)) = (shutdown_cancel, shutdown_exit) {
assert!(cancel < exit);
}
assert!(html.contains("cancelBackfillRun"));
assert!(html.contains("Annuler"));
assert!(frontend.contains("backfill_cancel"));
assert!(frontend.contains("{ jobId: status.jobId }"));
}