@@ -3814,7 +3814,7 @@ mod tests {
3814
3814
3815
3815
// Now make a new blueprint (with no meaningful changes) to ensure we
3816
3816
// can delete the last test blueprint we generated above.
3817
- let blueprint6 = BlueprintBuilder :: new_based_on (
3817
+ let mut blueprint6 = BlueprintBuilder :: new_based_on (
3818
3818
& logctx. log ,
3819
3819
& blueprint5,
3820
3820
& planning_input,
@@ -3824,6 +3824,23 @@ mod tests {
3824
3824
)
3825
3825
. expect ( "failed to create builder" )
3826
3826
. build ( ) ;
3827
+
3828
+ // Add ClickHouse configuration to exercise those tables
3829
+ if let Some ( ( _, sled_config) ) = blueprint6. sleds . iter ( ) . next ( ) {
3830
+ if let Some ( zone_config) = sled_config. zones . iter ( ) . next ( ) {
3831
+ let zone_id = zone_config. id ;
3832
+ let mut cfg = ClickhouseClusterConfig :: new (
3833
+ format ! ( "cluster-{TEST_NAME}" ) ,
3834
+ "test-secret" . into ( ) ,
3835
+ ) ;
3836
+ cfg. max_used_keeper_id = KeeperId :: from ( 1u64 ) ;
3837
+ cfg. max_used_server_id = ServerId :: from ( 1u64 ) ;
3838
+ cfg. keepers . insert ( zone_id, KeeperId :: from ( 1u64 ) ) ;
3839
+ cfg. servers . insert ( zone_id, ServerId :: from ( 1u64 ) ) ;
3840
+ blueprint6. clickhouse_cluster_config = Some ( cfg) ;
3841
+ }
3842
+ }
3843
+
3827
3844
datastore
3828
3845
. blueprint_insert ( & opctx, & blueprint6)
3829
3846
. await
@@ -4695,29 +4712,17 @@ mod tests {
4695
4712
/// Verify that every blueprint-related table contains ≥1 row across test blueprints.
4696
4713
/// Complements `ensure_blueprint_fully_deleted`.
4697
4714
fn ensure_fully_populated ( & self ) {
4698
- // Exception tables that may be empty in the test blueprints:
4699
- // - ClickHouse tables: only populated when blueprint includes ClickHouse configuration
4700
- let exception_tables = [
4701
- "bp_clickhouse_cluster_config" ,
4702
- "bp_clickhouse_keeper_zone_id_to_node_id" ,
4703
- "bp_clickhouse_server_zone_id_to_node_id" ,
4704
- ] ;
4705
-
4706
- // Check that all non-exception tables have at least one row
4715
+ // Check that all tables have at least one row
4707
4716
let empty_tables = self . empty_tables ( ) ;
4708
- let problematic_tables: Vec < _ > = empty_tables
4709
- . into_iter ( )
4710
- . filter ( |table| !exception_tables. contains ( & table. as_str ( ) ) )
4711
- . collect ( ) ;
4712
4717
4713
- if !problematic_tables . is_empty ( ) {
4718
+ if !empty_tables . is_empty ( ) {
4714
4719
panic ! (
4715
4720
"Expected tables to be populated across test blueprints: {:?}\n \n \
4716
4721
If every blueprint should be expected to have a value in this table, then this is a bug. \
4717
4722
Otherwise, you may need to add a table to the exception list in `ensure_fully_populated()`. \
4718
4723
If you do this, please ensure that you add a test to `test_representative_blueprint()` that creates a \
4719
4724
blueprint that _does_ populate this table and verifies it.",
4720
- problematic_tables
4725
+ empty_tables
4721
4726
) ;
4722
4727
}
4723
4728
}
0 commit comments