@@ -3149,6 +3149,7 @@ mod tests {
31493149 use nexus_reconfigurator_planning:: blueprint_builder:: EnsureMultiple ;
31503150 use nexus_reconfigurator_planning:: example:: ExampleSystemBuilder ;
31513151 use nexus_reconfigurator_planning:: example:: example;
3152+ use nexus_reconfigurator_planning:: planner:: Planner ;
31523153 use nexus_reconfigurator_planning:: planner:: PlannerRng ;
31533154 use nexus_types:: deployment:: BlueprintArtifactVersion ;
31543155 use nexus_types:: deployment:: BlueprintHostPhase2DesiredContents ;
@@ -3159,7 +3160,6 @@ mod tests {
31593160 use nexus_types:: deployment:: ExpectedActiveRotSlot ;
31603161 use nexus_types:: deployment:: PendingMgsUpdate ;
31613162 use nexus_types:: deployment:: PlanningInput ;
3162- use nexus_types:: deployment:: PlanningInputBuilder ;
31633163 use nexus_types:: deployment:: SledDetails ;
31643164 use nexus_types:: deployment:: SledDisk ;
31653165 use nexus_types:: deployment:: SledFilter ;
@@ -3191,16 +3191,12 @@ mod tests {
31913191 use std:: mem;
31923192 use std:: net:: Ipv6Addr ;
31933193 use std:: sync:: Arc ;
3194- use std:: sync:: LazyLock ;
31953194 use std:: sync:: atomic:: AtomicBool ;
31963195 use std:: sync:: atomic:: Ordering ;
31973196 use std:: time:: Duration ;
31983197 use tufaceous_artifact:: ArtifactHash ;
31993198 use tufaceous_artifact:: ArtifactVersion ;
32003199
3201- static EMPTY_PLANNING_INPUT : LazyLock < PlanningInput > =
3202- LazyLock :: new ( || PlanningInputBuilder :: empty_input ( ) ) ;
3203-
32043200 #[ derive( Default ) ]
32053201 pub struct NetworkResourceControlFlow {
32063202 pub target_check_done : Option < Arc < AtomicBool > > ,
@@ -3448,12 +3444,19 @@ mod tests {
34483444 let mut builder = BlueprintBuilder :: new_based_on (
34493445 & logctx. log ,
34503446 & blueprint1,
3451- & planning_input,
34523447 "test" ,
34533448 PlannerRng :: from_entropy ( ) ,
34543449 )
34553450 . expect ( "failed to create builder" ) ;
34563451
3452+ // We made changes to the planning input we want to be reflected in the
3453+ // new blueprint; reuse the `Planner`'s method for replicating those
3454+ // changes.
3455+ Planner :: update_builder_from_planning_input (
3456+ & mut builder,
3457+ & planning_input,
3458+ ) ;
3459+
34573460 // Ensure disks on our sled
34583461 assert_eq ! (
34593462 EnsureMultiple :: from(
@@ -3795,7 +3798,6 @@ mod tests {
37953798 let mut builder = BlueprintBuilder :: new_based_on (
37963799 & logctx. log ,
37973800 & blueprint2,
3798- & planning_input,
37993801 "dummy" ,
38003802 PlannerRng :: from_entropy ( ) ,
38013803 )
@@ -3851,7 +3853,6 @@ mod tests {
38513853 let mut builder = BlueprintBuilder :: new_based_on (
38523854 & logctx. log ,
38533855 & blueprint3,
3854- & planning_input,
38553856 "dummy" ,
38563857 PlannerRng :: from_entropy ( ) ,
38573858 )
@@ -3904,7 +3905,6 @@ mod tests {
39043905 let mut builder = BlueprintBuilder :: new_based_on (
39053906 & logctx. log ,
39063907 & blueprint4,
3907- & planning_input,
39083908 "dummy" ,
39093909 PlannerRng :: from_entropy ( ) ,
39103910 )
@@ -3961,7 +3961,6 @@ mod tests {
39613961 let blueprint6 = BlueprintBuilder :: new_based_on (
39623962 & logctx. log ,
39633963 & blueprint5,
3964- & planning_input,
39653964 "dummy" ,
39663965 PlannerRng :: from_entropy ( ) ,
39673966 )
@@ -4032,7 +4031,6 @@ mod tests {
40324031 let blueprint2 = BlueprintBuilder :: new_based_on (
40334032 & logctx. log ,
40344033 & blueprint1,
4035- & EMPTY_PLANNING_INPUT ,
40364034 "test2" ,
40374035 PlannerRng :: from_entropy ( ) ,
40384036 )
@@ -4041,7 +4039,6 @@ mod tests {
40414039 let blueprint3 = BlueprintBuilder :: new_based_on (
40424040 & logctx. log ,
40434041 & blueprint1,
4044- & EMPTY_PLANNING_INPUT ,
40454042 "test3" ,
40464043 PlannerRng :: from_entropy ( ) ,
40474044 )
@@ -4141,7 +4138,6 @@ mod tests {
41414138 let blueprint4 = BlueprintBuilder :: new_based_on (
41424139 & logctx. log ,
41434140 & blueprint3,
4144- & EMPTY_PLANNING_INPUT ,
41454141 "test3" ,
41464142 PlannerRng :: from_entropy ( ) ,
41474143 )
@@ -4180,7 +4176,6 @@ mod tests {
41804176 let blueprint2 = BlueprintBuilder :: new_based_on (
41814177 & logctx. log ,
41824178 & blueprint1,
4183- & EMPTY_PLANNING_INPUT ,
41844179 "test2" ,
41854180 PlannerRng :: from_entropy ( ) ,
41864181 )
@@ -4365,7 +4360,6 @@ mod tests {
43654360 let blueprint2 = BlueprintBuilder :: new_based_on (
43664361 & logctx. log ,
43674362 & blueprint1,
4368- & example_system. input ,
43694363 & format ! ( "{test_name}-2" ) ,
43704364 PlannerRng :: from_entropy ( ) ,
43714365 )
0 commit comments