Skip to content

Commit 8bb5e6f

Browse files
committed
Add ClickHouse config to blueprint6 and remove exception tables
1 parent 54abd47 commit 8bb5e6f

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

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

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3866,7 +3866,7 @@ mod tests {
38663866

38673867
// Now make a new blueprint (with no meaningful changes) to ensure we
38683868
// can delete the last test blueprint we generated above.
3869-
let blueprint6 = BlueprintBuilder::new_based_on(
3869+
let mut blueprint6 = BlueprintBuilder::new_based_on(
38703870
&logctx.log,
38713871
&blueprint5,
38723872
&planning_input,
@@ -3876,6 +3876,23 @@ mod tests {
38763876
)
38773877
.expect("failed to create builder")
38783878
.build(BlueprintSource::Test);
3879+
3880+
// Add ClickHouse configuration to exercise those tables
3881+
if let Some((_, sled_config)) = blueprint6.sleds.iter().next() {
3882+
if let Some(zone_config) = sled_config.zones.iter().next() {
3883+
let zone_id = zone_config.id;
3884+
let mut cfg = ClickhouseClusterConfig::new(
3885+
format!("cluster-{TEST_NAME}"),
3886+
"test-secret".into(),
3887+
);
3888+
cfg.max_used_keeper_id = KeeperId::from(1u64);
3889+
cfg.max_used_server_id = ServerId::from(1u64);
3890+
cfg.keepers.insert(zone_id, KeeperId::from(1u64));
3891+
cfg.servers.insert(zone_id, ServerId::from(1u64));
3892+
blueprint6.clickhouse_cluster_config = Some(cfg);
3893+
}
3894+
}
3895+
38793896
datastore
38803897
.blueprint_insert(&opctx, &blueprint6)
38813898
.await
@@ -4750,13 +4767,9 @@ mod tests {
47504767
/// Complements `ensure_blueprint_fully_deleted`.
47514768
fn ensure_fully_populated(&self) {
47524769
// Exception tables that may be empty in the test blueprints:
4753-
// - ClickHouse tables: only populated when blueprint includes ClickHouse configuration
47544770
// - debug log for planner reports: only populated when the blueprint
47554771
// was produced by the planner (test blueprints generally aren't)
47564772
let exception_tables = [
4757-
"bp_clickhouse_cluster_config",
4758-
"bp_clickhouse_keeper_zone_id_to_node_id",
4759-
"bp_clickhouse_server_zone_id_to_node_id",
47604773
"debug_log_blueprint_planning",
47614774
];
47624775

0 commit comments

Comments
 (0)