ALPHA: wire is a tool to deploy nixos systems wire.althaea.zone/
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

add tests for --no-keys and should_apply_locally

+46
+46
wire/lib/src/hive/node.rs
··· 672 672 ); 673 673 } 674 674 675 + #[tokio::test] 676 + async fn order_nokeys() { 677 + let location = location!(get_test_path!()); 678 + let mut node = Node::default(); 679 + 680 + let name = &Name(function_name!().into()); 681 + let mut context = Context::create_test_context(location, name, &mut node); 682 + context.no_keys = true; 683 + let executor = GoalExecutor::new(context); 684 + let steps = get_steps(executor); 685 + 686 + assert_eq!( 687 + steps, 688 + vec![ 689 + Ping.into(), 690 + crate::hive::steps::evaluate::Evaluate.into(), 691 + crate::hive::steps::build::Build.into(), 692 + crate::hive::steps::push::PushBuildOutput.into(), 693 + SwitchToConfiguration.into(), 694 + CleanUp.into() 695 + ] 696 + ); 697 + } 698 + 699 + #[tokio::test] 700 + async fn order_should_apply_locally() { 701 + let location = location!(get_test_path!()); 702 + let mut node = Node::default(); 703 + 704 + let name = &Name(function_name!().into()); 705 + let mut context = Context::create_test_context(location, name, &mut node); 706 + context.no_keys = true; 707 + context.should_apply_locally = true; 708 + let executor = GoalExecutor::new(context); 709 + let steps = get_steps(executor); 710 + 711 + assert_eq!( 712 + steps, 713 + vec![ 714 + crate::hive::steps::evaluate::Evaluate.into(), 715 + crate::hive::steps::build::Build.into(), 716 + SwitchToConfiguration.into(), 717 + ] 718 + ); 719 + } 720 + 675 721 #[test] 676 722 fn target_fails_increments() { 677 723 let mut target = Target::from_host("localhost");