Skip to content

Conversation

sarataha
Copy link
Contributor

@sarataha sarataha commented Sep 4, 2025

This is a follow up PR to #8667 as suggested by @davepacheco in #8667 (comment)

Instead of verifying table coverage for individual blueprint insertions, this change tracks coverage cumulatively across all tests in test_representative_blueprint().

@davepacheco
Copy link
Collaborator

Thanks for taking this one on. I just wanted to give you a heads-up that I probably won't be able to look for a week or two. (If anyone else at Oxide can take a look, go for it!)

@sarataha sarataha marked this pull request as ready for review September 6, 2025 13:19
Copy link
Collaborator

@davepacheco davepacheco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good. I have a few small suggestions, but we don't have to make most of these changes.

@sarataha sarataha force-pushed the blueprint-coverage-test branch from bd8bde9 to 8bb5e6f Compare October 1, 2025 21:37
Copy link
Collaborator

@davepacheco davepacheco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment on lines 3867 to 3868
// Now make a new blueprint (with no meaningful changes) to ensure we
// can delete the last test blueprint we generated above.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment doesn't seem right any more.

I think what you want to do is add a new lap before this one that includes the Clickhouse stuff. Then keep the existing lap that makes basically no changes.

Comment on lines +4770 to +4773
// Exception tables that may be empty in the test blueprints:
// - debug log for planner reports: only populated when the blueprint
// was produced by the planner (test blueprints generally aren't)
let exception_tables = ["debug_log_blueprint_planning"];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true @jgallagher? I forget where we came down on this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is true; a blueprint is specified by

pub enum BlueprintSource {
    /// The initial blueprint created by the rack setup service.
    Rss,
    /// A blueprint created by the planner, and we still have the associated
    /// planning report.
    Planner(Arc<PlanningReport>),
    /// A blueprint created by the planner but loaded from the database, so we
    /// no longer have the associated planning report.
    PlannerLoadedFromDatabase,
    /// This blueprint was created by one of `reconfigurator-cli`'s blueprint
    /// editing subcommands.
    ReconfiguratorCliEdit,
    /// This blueprint was constructed by hand by an automated test.
    Test,
}

and when we go to insert the blueprint to the db, we only insert a row in debug_log_blueprint_planning if the source is BlueprintSource::Planner(some_report).

Comment on lines +4775 to +4780
// Check that all non-exception tables have at least one row
let empty_tables = self.empty_tables();
let problematic_tables: Vec<_> = empty_tables
.into_iter()
.filter(|table| !exception_tables.contains(&table.as_str()))
.collect();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if it's worth keeping the previous list of exception tables, which would basically leave us with three categories:

  1. debug_log_blueprint_planning: could be empty?
  2. the previous exception tables: they should now all have one row (this is included in the check here)
  3. the previous non-exception tables: they should now all have num_blueprints rows

I think I'm coming down on what you've got here though. The real goal here is to make sure that we can successfully round-trip everything through the database, and that's what we've verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants