Skip to content

Commit 6d70107

Browse files
committed
fixup datastore tests that use blueprint builder
1 parent 987d4d5 commit 6d70107

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

nexus/db-queries/src/db/datastore/deployment.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,7 @@ mod tests {
19881988
use nexus_reconfigurator_planning::blueprint_builder::Ensure;
19891989
use nexus_reconfigurator_planning::blueprint_builder::EnsureMultiple;
19901990
use nexus_reconfigurator_planning::example::example;
1991+
use nexus_reconfigurator_planning::planner::disks_editor::BlueprintDisksEditor;
19911992
use nexus_types::deployment::blueprint_zone_type;
19921993
use nexus_types::deployment::BlueprintZoneConfig;
19931994
use nexus_types::deployment::BlueprintZoneDisposition;
@@ -2322,18 +2323,17 @@ mod tests {
23222323
"test",
23232324
)
23242325
.expect("failed to create builder");
2326+
let mut disks_editor = BlueprintDisksEditor::new(&blueprint1);
23252327

23262328
// Ensure disks on our sled
23272329
assert_eq!(
2328-
builder
2329-
.sled_ensure_disks(
2330-
new_sled_id,
2331-
&planning_input
2332-
.sled_lookup(SledFilter::Commissioned, new_sled_id)
2333-
.unwrap()
2334-
.resources,
2335-
)
2336-
.unwrap(),
2330+
disks_editor.sled_ensure_disks(
2331+
new_sled_id,
2332+
&planning_input
2333+
.sled_lookup(SledFilter::Commissioned, new_sled_id)
2334+
.unwrap()
2335+
.resources,
2336+
),
23372337
EnsureMultiple::Changed {
23382338
added: 4,
23392339
updated: 0,
@@ -2360,7 +2360,7 @@ mod tests {
23602360
let num_new_crucible_zones = new_sled_zpools.len();
23612361
let num_new_sled_zones = num_new_ntp_zones + num_new_crucible_zones;
23622362

2363-
let blueprint2 = builder.build();
2363+
let blueprint2 = builder.build(disks_editor);
23642364
let authz_blueprint2 = authz_blueprint_from_id(blueprint2.id);
23652365

23662366
let diff = blueprint2.diff_since_blueprint(&blueprint1);
@@ -2514,7 +2514,7 @@ mod tests {
25142514
"test2",
25152515
)
25162516
.expect("failed to create builder")
2517-
.build();
2517+
.build(BlueprintDisksEditor::new(&blueprint1));
25182518
let blueprint3 = BlueprintBuilder::new_based_on(
25192519
&logctx.log,
25202520
&blueprint1,
@@ -2523,7 +2523,7 @@ mod tests {
25232523
"test3",
25242524
)
25252525
.expect("failed to create builder")
2526-
.build();
2526+
.build(BlueprintDisksEditor::new(&blueprint1));
25272527
assert_eq!(blueprint1.parent_blueprint_id, None);
25282528
assert_eq!(blueprint2.parent_blueprint_id, Some(blueprint1.id));
25292529
assert_eq!(blueprint3.parent_blueprint_id, Some(blueprint1.id));
@@ -2623,7 +2623,7 @@ mod tests {
26232623
"test3",
26242624
)
26252625
.expect("failed to create builder")
2626-
.build();
2626+
.build(BlueprintDisksEditor::new(&blueprint3));
26272627
assert_eq!(blueprint4.parent_blueprint_id, Some(blueprint3.id));
26282628
datastore.blueprint_insert(&opctx, &blueprint4).await.unwrap();
26292629
let bp4_target = BlueprintTarget {
@@ -2668,7 +2668,7 @@ mod tests {
26682668
"test2",
26692669
)
26702670
.expect("failed to create builder")
2671-
.build();
2671+
.build(BlueprintDisksEditor::new(&blueprint1));
26722672
assert_eq!(blueprint1.parent_blueprint_id, None);
26732673
assert_eq!(blueprint2.parent_blueprint_id, Some(blueprint1.id));
26742674

@@ -2896,7 +2896,7 @@ mod tests {
28962896
"test2",
28972897
)
28982898
.expect("failed to create builder")
2899-
.build();
2899+
.build(BlueprintDisksEditor::new(&blueprint1));
29002900

29012901
// Insert both into the blueprint table.
29022902
datastore.blueprint_insert(&opctx, &blueprint1).await.unwrap();

nexus/db-queries/src/db/datastore/vpc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2766,6 +2766,7 @@ mod tests {
27662766
use nexus_db_model::IncompleteNetworkInterface;
27672767
use nexus_db_model::SledUpdate;
27682768
use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder;
2769+
use nexus_reconfigurator_planning::planner::disks_editor::BlueprintDisksEditor;
27692770
use nexus_reconfigurator_planning::system::SledBuilder;
27702771
use nexus_reconfigurator_planning::system::SystemDescription;
27712772
use nexus_types::deployment::Blueprint;
@@ -3129,7 +3130,7 @@ mod tests {
31293130
Vec::new(),
31303131
)
31313132
.expect("added nexus to third sled");
3132-
builder.build()
3133+
builder.build(BlueprintDisksEditor::new(&bp0))
31333134
};
31343135
bp_insert_and_make_target(&opctx, &datastore, &bp1).await;
31353136

@@ -3201,7 +3202,7 @@ mod tests {
32013202
)
32023203
.expect("added nexus to third sled");
32033204
}
3204-
builder.build()
3205+
builder.build(BlueprintDisksEditor::new(&bp2))
32053206
};
32063207

32073208
// Insert the service NIC records for all the Nexuses.

nexus/reconfigurator/planning/src/blueprint_builder/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,7 @@ impl<'a> BlueprintZonesBuilder<'a> {
18271827
/// Iterates over the list of Omicron zones currently configured for this
18281828
/// sled in the blueprint that's being built, along with each zone's state
18291829
/// in the builder.
1830-
pub fn current_sled_zones(
1830+
pub(crate) fn current_sled_zones(
18311831
&self,
18321832
sled_id: SledUuid,
18331833
filter: BlueprintZoneFilter,

0 commit comments

Comments
 (0)