From 06d455ab53178ded8eafbbe31a086e1abb62b8ba Mon Sep 17 00:00:00 2001 From: marshmallow Date: Fri, 19 Dec 2025 17:05:56 +1100 Subject: [PATCH] add tests for --no-keys and should_apply_locally --- wire/lib/src/hive/node.rs | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/wire/lib/src/hive/node.rs b/wire/lib/src/hive/node.rs index bb0fd14..165ea50 100644 --- a/wire/lib/src/hive/node.rs +++ b/wire/lib/src/hive/node.rs @@ -672,6 +672,52 @@ mod tests { ); } + #[tokio::test] + async fn order_nokeys() { + let location = location!(get_test_path!()); + let mut node = Node::default(); + + let name = &Name(function_name!().into()); + let mut context = Context::create_test_context(location, name, &mut node); + context.no_keys = true; + let executor = GoalExecutor::new(context); + let steps = get_steps(executor); + + assert_eq!( + steps, + vec![ + Ping.into(), + crate::hive::steps::evaluate::Evaluate.into(), + crate::hive::steps::build::Build.into(), + crate::hive::steps::push::PushBuildOutput.into(), + SwitchToConfiguration.into(), + CleanUp.into() + ] + ); + } + + #[tokio::test] + async fn order_should_apply_locally() { + let location = location!(get_test_path!()); + let mut node = Node::default(); + + let name = &Name(function_name!().into()); + let mut context = Context::create_test_context(location, name, &mut node); + context.no_keys = true; + context.should_apply_locally = true; + let executor = GoalExecutor::new(context); + let steps = get_steps(executor); + + assert_eq!( + steps, + vec![ + crate::hive::steps::evaluate::Evaluate.into(), + crate::hive::steps::build::Build.into(), + SwitchToConfiguration.into(), + ] + ); + } + #[test] fn target_fails_increments() { let mut target = Target::from_host("localhost"); -- 2.51.2