From e86d7a20b96855cf7b4531b8febf77cdba6bd7c8 Mon Sep 17 00:00:00 2001 From: hnoerenberg Date: Tue, 24 Nov 2026 22:14:37 +0100 Subject: [PATCH] test(atn): start the engine guard tests from an installed session CI runs one test process per test. These four started from a bare Session::new(), so the first command returned NotInstalled and the unwrap panicked: crates/engine-core/src/cmd/actions_cmds/tests.rs:438 in recording_starts_with_no_document_open, and :447 in the shared helper other_names_document that the three playback pins call. Every other test in this file starts from crate::session(), which installs this crate's commands first; the four now do the same. Verified per test rather than per run: run alone, each of the four failed before this change (unwrap on Err(NotInstalled)) and passes alone after it. A single whole-lib process hides this because one test's install serves the rest; the whole lib stays green either way (3276 passed, 0 failed). --- crates/engine-core/src/cmd/actions_cmds/tests.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/engine-core/src/cmd/actions_cmds/tests.rs b/crates/engine-core/src/cmd/actions_cmds/tests.rs index 1fca1396ab..bd729d5c9e 100644 --- a/crates/engine-core/src/cmd/actions_cmds/tests.rs +++ b/crates/engine-core/src/cmd/actions_cmds/tests.rs @@ -434,7 +434,7 @@ fn recording_document_activation_uses_opening_order_offset() { /// with none open, and the commands that create and edit a document land in the action. #[test] fn recording_starts_with_no_document_open() { - let mut s = Session::new(); + let mut s = crate::session(); s.execute("actions.record", json!({"name": "Open and ink"})).unwrap(); s.execute("file.new", json!({"width": 8, "height": 8})).unwrap(); s.execute("layer.new.layer", json!({"name": "Ink"})).unwrap(); @@ -462,7 +462,7 @@ fn played_layer_names(s: &Session) -> Vec { /// from the document the recording was made on. #[test] fn a_step_naming_a_missing_layer_stops_instead_of_acting_on_the_wrong_layer() { - let mut s = Session::new(); + let mut s = crate::session(); other_names_document(&mut s); s.actions_mut() .list @@ -479,7 +479,7 @@ fn a_step_naming_a_missing_layer_stops_instead_of_acting_on_the_wrong_layer() { /// there without hiding one of the present layers. #[test] fn an_eye_step_naming_a_missing_layer_stops_without_hiding_another_layer() { - let mut s = Session::new(); + let mut s = crate::session(); other_names_document(&mut s); s.actions_mut() .list @@ -496,7 +496,7 @@ fn an_eye_step_naming_a_missing_layer_stops_without_hiding_another_layer() { /// whatever layer is selected there, as the reference records it (Ctrl+J copied Z). #[test] fn a_target_step_acts_on_the_selected_layer_of_another_document() { - let mut s = Session::new(); + let mut s = crate::session(); other_names_document(&mut s); s.actions_mut().list.push(Action::new("Dim", vec![ActionStep::new("layer.setProps", json!({"opacity": 0.5}))])).unwrap(); let played = s.execute("actions.play", json!({"action": "Dim"})).unwrap();